Fix the path and token-logging reviews JevGate got wrong on vaultwarden - #34
Merged
Merged
Conversation
…e the security fixes Path findings are asked what their paths can hold, with the project's types their parameters name; leaning toward names that stay in their directory, they are notes. Log findings are asked when the line runs; a setting an operator turns on to log those values makes them notes. On the 17 corpus projects with such findings: vaultwarden's 4 path reviews on typed Rocket parameters and 2 opt-in token logs (vaultwarden, pgweb), all labeled wrong, are notes; no finding labeled right changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The vaultwarden PR (dani-garcia/vaultwarden#7777) says that 10 of JevGate's 16 security reviews there were wrong and that those are JevGate's bugs to fix. This fixes the two classes it named:
PathBufsegments, and id types whoseFromParamaccepts only a UUID or[A-Za-z0-9-], can't carry... The path check only reads "a variable joined to a directory". An injection finding that rests only on a path is now asked, as a finding-only follow-up, what the path's variable parts can hold. It gets its callers and the definitions of the project's types its parameters name, with their attributes (e.g.#[derive(UuidFromParam)] pub struct CipherId(String);). If the answer leans toward names that stay inside their directory, the finding is a note, with its own message.Measured on the 17 corpus projects with path or log findings, with the new follow-ups paid for (under $0.01) and reruns free:
web_files,attachments,static_files_dev,download_send), labeled wrongsso_client.rstokens underSSO_DEBUG_TOKENS, labeled wrongRequestLogger, labeled wrongOn my patched vaultwarden branch, the
sso.rsline moved under the same gate is a note too.The path lean uses the 0.50 leaning share, as the
valuesfollow-up of injection considers does. The four wrong ones landed at 0.67–0.78 because a type's parsing is visible only by its derive name; every right one was near 0 confined.Also:
enumsand the newtypesshare one definition index, andunlocated_unitsdelegates tolocate_due(both flagged by the self-check).INJECTIONandSENSITIVE_DATArule versions are bumped.Tests (451 + new ones for both follow-ups, each checked to fail without its rule), clippy and
cargo +1.90.0 check --lockedpass. The self-check reports no review or consider.