Skip to content

security/cookie-flags and security/token-storage: rate higher and name the hosts when third-party scripts run on the site #2089

Description

@nc9

Problem

The payload served through Optimizely snippets on 16 November 2026 sent document.cookie to the attacker's server (Report URI write-up). Only cookies without HttpOnly are readable that way, and the write-up advises affected sites to treat session tokens in such cookies as exposed.

security/cookie-flags reports cookies set without HttpOnly, and security/token-storage reports tokens kept in web storage. Neither considers who else runs code on the site. The same missing flag is a much larger exposure on a site that loads a dozen third-party scripts than on one that loads none, and the finding reads the same on both.

Wanted

When third-party scripts run on the site, these findings say so, name the hosts, and rate higher.

Acceptance Criteria

  • A session-like cookie set without HttpOnly, on a site whose pages load third-party scripts, is reported one severity step higher than on a site with none, and the finding names the third-party script hosts that could read it (capped, with a count of the rest).
  • A token that security/token-storage finds in localStorage or sessionStorage gets the same treatment.
  • On a site with no third-party script, both rules report exactly as they do today, and their existing fixtures are unchanged.
  • The finding text does not call any vendor malicious. It states that any script on the page can read the value.
  • Fixtures cover both cases for both rules, and both docs pages describe the change.

Activity

  1. added
    enhancement
    size: S
    rules
    security
    on Nov 16, 2026
  2. added theissue type on Nov 17, 2026
  3. added a commit that references this issue on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessecuritysize: S

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions