trifectatechfoundation / trifectatechfoundation/sudo-rs
Should "garbage at end of line" be a hard error?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 179
- Avg merge
- 16h 45m
- Merged PRs (30d)
- 4
Description
This was raised by email by @KaraZajac. Right now if 'garbage at end of line' is detected, the previous bits have been succesfully parser and accepted. This is e.g. to make sure incorrect line-endings don't cause full lock-outs.
In the case of other parse-errors (or bugs in the parser), it is conceivable that this causes incomplete config lines to be accepted (albeit with a warning). We could also add code that ensures that, in the case of a "garbage at end of line" error, the part before it is rejected also. This would in effect add some extra defense in depth.
We could also do this in an intelligent manner rather than all-or-nothing; in a similar vein, we ignore NOINTERCEPT as a keyword (sudo-rs emits a warning for it, but the rest of the configuration rule will continue to be understood), but if we encounter INTERCEPT that means we reject the whole rule since we don't implement subcommand interception.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Rust parser path that detects "garbage at end of line" and compare it with handling for NOINTERCEPT and INTERCEPT. Determine whether the intended behavior is to reject the parsed prefix, selectively reject rules, or preserve the warning behavior; done should include a decided policy and coverage for the relevant parse cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100