Repository navigation
Conversation
…te to 1 MB, CSS rule bounds with cssTruncated, base href #1423 Signed-off-by: Nik Cubrilovic <[email protected]>
…class signal, rank under moved base, base placement, empty link href #1423 Signed-off-by: Nik Cubrilovic <[email protected]>
…ancestor walk; foreignObject base honoured; notes and tests #1423 Signed-off-by: Nik Cubrilovic <[email protected]>
…cap; nesting cannot decide which base wins #1423 Signed-off-by: Nik Cubrilovic <[email protected]>
…nnot flip them; math base cases #1423 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.159 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 #1423.
Three integrity-rule bounds could be passed with cheap padding and gave no signal.
<span style="[8.4 KB of a:b;]display:none">inside a label was read as visible and broke the phrase. It is now read to 1 MB, once per element (cached, so a control nested around a big one does not re-read it); a control with a longer style attribute is counted incontrolsUnread.cssTruncated; an oversized rule that may hide a class or id giveshiddenCssTruncatedonbrand-impersonationwhen controls exist and nothing was found. A larger rule for something else is still skipped, since it cannot match.<base href>. A link or form action was always resolved against the page URL. The first<base href>(as a browser reads it) now decides: a relative link under a base on another host is judged by that host, a plainly local link is no longer skipped as the site's own while the base moves it, an empty form action still goes to the page, an empty linkhrefgoes to the base, links rank as off-site under a moved base (so node floods cannot push them out of the longer read), a<base>inside svg, math, noscript or template is ignored, and a relative iframesrcinfake-auth-overlayresolves against the base too. Adata:/javascript:base, a base withouthref, and a second base are ignored.Acceptance criteria
cssTruncated<base href>on another host is judged by that hostintegrity-bounds-1423.test.tsfail on main and pass hereBase resolution is linear (review round 2):
documentBasewas called per iframe and scanned the document each time (10,000 iframes with a password form: 4.4 s before, 13 ms now; main 13 ms), anddocumentBaseHrefwalked every ancestor of every<base>(4,000 nested<g>with 16,000 bases was seconds; 20,000<g>with 80,000 bases and the same inside a deep<noscript>: 34 ms, 27 ms brand, main 25 ms). The base is now found once per document (cached) in one iterative pass in document order with no depth bound: a depth cap fails in both directions (a deep ignored<base>in noscript, template or svg read as honoured can false-flag, or hide a finding when it is a plain-local decoy placed before the real base; a cap that reads deep as ignored hides a real deep base), so nesting never decides which base wins. Probes at depths 63, 64, 65, 200 and 2,000 inside noscript, template, svg and foreignObject, with decoys, are tests; the capped version failed them. 20,000 nested<g>with 80,000 bases: 48 ms overlay, 34 ms brand (main 31 and 26); 30,000 iframes: 75 ms (main 36); 200,000 flat nodes: 82 and 77 ms (main 70 and 72). A<base>inside<svg><foreignObject>is an HTML element and is honoured.Notes:
hiddenCssTruncatedappears on the info note when nothing is found and in the finding'sdetails; it is also emitted on a clean page with such a rule and a sign-in label, and the docs say so.Linear: the style cache and the bounded CSS scans keep the hostile cases (a megabyte of separators,
;plus 900 KB of spaces, 300 nested controls around one 800 KB style) in seconds.Skill change: none.