Skip to content

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 #2298

Description

@nc9

security/cookie-flags now emits cookie-httponly-third-party-scripts (fail) for session-like cookies without HttpOnly on pages that load third-party scripts; those cookies used to be reported under cookie-httponly (warn) (#2260). Nothing links the two checks, so on the next audit of a site that already had the warning, the old finding reads as resolved and a new failing finding appears. On hosted audits that shows up as "new failures" in digests and can open new high-priority issues.

The engine already has a supersededChecks mechanism on rule meta (packages/audit-engine/src/merge-core.ts, buildSupersededIndex in packages/core-contracts/src/resolution.ts; used by meta-title, meta-description, broken-links, broken-external-links). cookie-flags does not declare one.

Approach (revised 11-24): no supersede and no second check name. Keep the single check cookie-httponly and decide its status: fail for a session-like cookie without HttpOnly on a page that loads third-party scripts (message names the third-party-script risk and hosts), warn otherwise. The finding key is then unchanged and an existing finding goes warn -> fail in place (worsened), as security/token-storage already does.

Acceptance Criteria

  • security/cookie-flags emits no cookie-httponly-third-party-scripts check and declares no supersededChecks; HttpOnly findings always use check cookie-httponly
  • A session-like cookie without HttpOnly on a page with third-party scripts is cookie-httponly at fail, and the message names the third-party-script risk and the hosts; a test covers it
  • The same cookie on a page without third-party scripts (or a non-session cookie) is cookie-httponly at warn; a test covers it
  • A test asserts the check name and locator are identical in both cases, so the finding key is unchanged when the status moves warn -> fail
  • A fixed cookie (HttpOnly set) resolves; a test covers it
  • The rule docs page describes one check with two severities
  • The changelog.d entry notes that 0.0.191-beta.1 shipped the separate check name, so beta users' local stores will see it disappear and cookie-httponly return at fail

Activity

  1. added
    bug
    rules
    size: M
    in-progress
    on Nov 24, 2026
  2. self-assigned this
    on Nov 24, 2026
  3. added theissue type on Nov 24, 2026
  4. changed the title [-]cookie-flags: link cookie-httponly to its third-party-scripts successor so a moved cookie is one finding getting worse[/-] [+]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[/+] on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugin-progressrulessize: M

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions