You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
content/hidden-text: a CSS parser differential reads a stylesheet as hiding what a browser shows #679
Summary.content/hidden-text reads a stylesheet with an unquoted url( containing braces as hiding an element that a browser shows. The default-mode CSS rule parser (parseRules, scanDeclarations) treats {, } and ; inside an unquoted url(...), inside (/[ blocks, and after a backslash escape as structure, so the following rule is read wrongly.
Repro (HTTP mode, local fixture):
<style>.a{background:url(}.b{display:none}.c{)}</style><pclass="b">Sixty or more characters of ordinary visible paragraph text go here, so the rule has something to flag.</p>
Actual: .b is read as display:none, so the paragraph counts as hidden text. In Chromium (getComputedStyle) .b is displayed: the unquoted url( swallows the braces as one token, so display:none never applies.
Same default-mode blind spot for \} escapes and } inside (/[ blocks. A strict mode that handles these (stepBlocks, skipUnquotedUrl in css-scan.ts) exists on the side branch wip/static-hidden-cascade-664-665 at ee5a5d6 and could be ported.
Acceptance Criteria
The repro fixture does not produce a hidden-text finding.
} and ; inside an unquoted url(...), inside (/[ blocks, and after a backslash escape are not read as structure.
A plainly written display:none rule still produces the finding, and existing hidden-text tests pass.
The scanner stays linear time on hostile input (a flood of (, [ or url( runs in well under a second).
A test row set derived from headless Chromium covers each construct.
Fixed in # and merged to main. Every acceptance criterion is met per the PR description, with before and after evidence from the CLI on local fixtures, tests that fail on the old code, and review comments triaged. Criteria ticked.
Activity
fix(rules): read url(), blocks and escapes like a browser in content/…
fix(rules): read url(), blocks and escapes like a browser in content/…
nc9 commentedon Oct 12, 2026
Fixed in # and merged to main. Every acceptance criterion is met per the PR description, with before and after evidence from the CLI on local fixtures, tests that fail on the old code, and review comments triaged. Criteria ticked.