Ask markup and redirect findings what their values hold and where they lead - #35
Merged
Merged
Conversation
…ape, split injection wording The redirect options now name the forms: a fixed path such as /admin first stays on the site; origin + next with no slash between them does not. Offered only "origin and a slash", chatbot-ui's origin + next read as staying on the site at 0.63; with the forms it is 0.93 anywhere. On the 38 corpus projects with path, markup or redirect findings: vaultwarden's hibp_breach and admin login redirect and shiori's login redirect, all labeled wrong, are notes; the 26 markup and 6 redirect findings labeled right put at most 0.22 and 0.44 on the harmless options.
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.
Follow-up to #34 for three more of the vaultwarden reviews that were wrong, and the same causes elsewhere in the corpus.
The confirm request #34 added for path findings now asks three questions, and a finding reads only the one for its kind:
hibp_breachpercent-encodes the username withform_urlencoded::byte_serializebefore building the link./adminfirst keeps them on the site;origin + nextwith no slash between them does not. vaultwarden's admin login redirects toadmin_path()followed by the form value, and shiori's to its login page with the path only in the query.A finding whose one concern is markup or a redirect is asked this, unless it's a consider on parameters, which keeps its existing "values" Choice. Leaning (0.50) toward the harmless options makes it a note, with its own message.
Measured on the 38 corpus projects with path, markup or redirect findings. Only confirm requests were asked, about $0.01.
hibp_breach(markup),post_admin_login(redirect), shiorigetBookmark(redirect), all labeled wrongexamples/authlogin redirect to the RefererThe first wording of the redirect options ("the program's own origin and a slash") let chatbot-ui's real open redirect (
requestUrl.origin + next, sonext=@evil.comleaves the site) read as staying on the site at 0.63. The options now write out both forms: that finding answers "anywhere" at 0.93, and none of the right ones move.With #34, vaultwarden's security reviews go from 16 to 9: the 6 right ones, plus
backup_db(its error type'sDisplay, which a macro generates, only writes the program's messages),decode_token_claims, and the debatable email-token log. Those are single cases, left alone rather than tuned to.Also: the self-check flagged
injection_wordingonce it grew, so the page-script and confirmed-note wordings are now their own functions.INJECTIONrule version bumped.Tests (including one for markup and redirect, checked to fail without the rule), clippy and
cargo +1.90.0 check --lockedpass; the self-check reports no review or consider.