Repository navigation
Conversation
…sh as slash #1495 Signed-off-by: Nik Cubrilovic <[email protected]>
…hortlisting, property-tested; sign-in path read to 8,192 characters #1495 Signed-off-by: Nik Cubrilovic <[email protected]>
…ext computed once per control; bounds tests #1495 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.156 as nik |
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.
Closes #1495.
shortlist()decides own-site or off-site onurlText(href)(tabs and newlines removed, leading controls stripped), butrank()read the rawhrefand tested protocol-relative with//only. A destination written with a backslash or split by a tab ranked 1 (local): no long read of its label and nocontrolsUnreadwhen the label was cut.rank()now takesurlText(href)and treats a backslash as a slash (^(?:scheme:)?[\\/]{2}).Tests (
integrity-evasions-784.test.ts, 39 pass)https://,//,/\,\\,/+ tab +/,/+ newline +/, a leading space and a leading tab form: fails without the change (checked by running the file against the unchanged source: 1 failure)./x,x/y,#top) still does not get the long read.Docs and CHANGELOG updated. Skill change: none.
nik
Review round: differential against the URL parser
looksOffSite(href)(exported) now carries the classification for ranking and for the shortlist's read order: protocol-relative after normalisation (//,\\,/\,\/, tab/newline-split slashes, a leading space or control character), anyscheme://, and anhttp/https/ws/wss/ftpscheme with or without slashes (http:hoston an https page ishttp://host). It leans toward reading. The sign-in path is tested on the normalised text up to 8,192 characters instead of the first 300 of the raw one, so padding the path or the query cannot hide it.Property tests against
new URL(href, "https://example.com/")(about 5,000 generated hrefs: 11 prefixes (empty, space, tab, newline, CR, NUL, 0x01, 0x1f, mixes) x about 60 openers (slash and backslash mixes, tab/newline/space-split,///,////,https:/\,http:\\,HTTP://,hTtP://,ws:,ftp:,file:, dot segments/./\,/..//,?//,#//, percent-encoded%2f,%5c,%09, non-hierarchical schemes) x 7 bodies (host, host with port, userinfo and look-alike hosts, a bare name)):looksOffSiteis true;No mismatch was found; the tests fail if the backslash or tab handling is removed. Percent-encoded
%2f/%5care path characters to the parser and are treated as local, as it does.Round 2 (independent review)
looksOffSitedropped from theshortlist()bucket line (60,500 off-site decoys no longer fill the 60,000 cap ahead of a real control);rank()still reads off-site first.integrity-budget-1424.test.ts"100,000 tiny controls" passes again; whole budget set run (784, nested, 1424, 1424-decoys, 1465-bounds) plus the new file.shortlist()and passed torank().integrity-budget-1495.test.ts: bucket order (tab-split sign-in path, 1,000/8,000/9,000-char paths, off-site not promoted),rank()cases, 60,500 decoys before a form button / off-site oauth link / tab-split path / long path, 1 MB tab-padded href. Mutants killed: promote off-site, raw text in shortlist, 300-char read, no cap (shortlist and rank), no AUTH_PATH in rank.Skill change: none.