Skip to content

fix(rules): one cookie-httponly check that fails on pages with third-party scripts #2298 - #2299

Merged
nc9 merged 3 commits into
mainfrom
fix/cookie-httponly-supersede-2298
Nov 24, 2026
Merged

nc9 merged 3 commits into
mainfrom
fix/cookie-httponly-supersede-2298

Conversation

@nc9

@nc9 nc9 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2298.

Reworked: no supersede and no second check name. security/cookie-flags emits only cookie-httponly. A session-like cookie without HttpOnly on a page that loads third-party scripts is cookie-httponly at fail (message names the risk and hosts, details carry the hosts); every other cookie without HttpOnly is cookie-httponly at warn. A check holds one status, so the two severities are two results under the same name, each item keyed by cookie name, so the finding key (page, rule, check, locator) is identical at warn and fail. A prior warn finding becomes the same key at fail, state open, first-seen kept.

Removed: the cookie-httponly-third-party-scripts check and its meta entries, the supersededChecks declaration, the first-round engine test and the rule-check-declarations entry. Docs 'Retired check names' block regenerated (gone).

Acceptance criteria

  • no third-party-scripts check, no supersededChecks: cookie-flags.test.ts 'fail under cookie-httponly' and cookie-httponly-worsened-2298.test.ts 'declares no superseded checks'
  • fail with hosts in message: cookie-flags.test.ts first third-party test
  • warn without scripts / non-session: 'no third-party script warns', 'non-session cookie alone warns', 'beside the failing one'
  • identical name and locator: 'check name and locator are identical at warn and at fail'
  • fixed cookie resolves: 'a fixed cookie resolves the prior finding' (engine) and 'HttpOnly session cookie is not raised'
  • docs: docs/rules/security/cookie-flags.mdx describes one check, two severities
  • changelog.d/2298-cookie-httponly-one-check.fixed.md notes the 0.0.191-beta.1 check name

Note: the engine has no separate 'worsened' diff kind in public code, so the engine test asserts the same key, status warn to fail, state open and firstSeenAt kept.

Gates: rules full suite 12970 pass 0 fail; audit-engine full 1173+1040+243 pass 0 fail (split to fit the timeout); format:check, lint, typecheck clean in rules and audit-engine; make validate in docs passes. Skill change: none needed.

…ponly for the same cookie #2298

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 marked this pull request as ready for review November 24, 2026 07:56
@nc9
nc9 marked this pull request as draft November 24, 2026 08:06
@nc9 nc9 changed the title fix(rules): cookie-httponly-third-party-scripts supersedes cookie-httponly for the same cookie #2298 fix(rules): one cookie-httponly check that fails on pages with third-party scripts #2298 Nov 24, 2026
@nc9
nc9 marked this pull request as ready for review November 24, 2026 09:37
@nc9
nc9 merged commit be2ed1b into main Nov 24, 2026
10 checks passed
@nc9
nc9 deleted the fix/cookie-httponly-supersede-2298 branch November 24, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cookie-flags: keep one cookie-httponly check and raise it to fail on pages with third-party scripts, so a moved cookie is one finding getting worse

1 participant