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
waf-detect: an unclosed <code> hides the rest of the page from block-page wording #904
signatureViews in packages/waf-detect/src/views.ts drops the text inside <code>, <kbd> and <samp> from the text view, so a page that quotes a block-page line in a code block is not attributed to the WAF. It counts how deep it is inside those elements, and the count only goes down on their closing tags. An unclosed <code> therefore hides the rest of the 10 KB sample from the text view. The HTML parser would have closed it at the next block boundary.
If a real block or challenge page has a stray <code> before its wording (a Cloudflare ray id, an Imperva incident line, CloudFront's footer), it is no longer recognised from that wording. Its markup signatures (scripts, ids) are unaffected.
Acceptance Criteria
An unclosed <code>, <kbd> or <samp> stops hiding text at the next block-level boundary (for example </p>, </div>, </pre>, </li>, </td>, </body>), as the HTML parser closes it
Test: a block page with a stray <code> before its incident line is still attributed to the provider
Test: a properly closed <pre><code> quoting the same line is still not attributed
Activity
fix(waf-detect): an unclosed <code> stops hiding wording at its block…