Skip to main content
Security Auditor — reads every Set-Cookie header the audited URL sends and checks that each cookie carries HttpOnly, Secure (on HTTPS), a valid SameSite and well-formed Domain and Path attributes.

Protection

Keeps session and login cookies away from page scripts, plain-HTTP eavesdroppers and requests started by other sites.

Standards

Follows RFC 6265 (HTTP State Management Mechanism) and the SameSite attribute from its revision in progress, draft-ietf-httpbis-rfc6265bis.
Cookies are how a site remembers who a visitor is. A session cookie that a script can read, that travels over plain HTTP or that rides along with requests started by other sites is a session an attacker can take over. The Set-Cookie attributes HttpOnly, Secure and SameSite close those three doors, and Domain and Path must be well-formed or browsers drop the cookie altogether. This auditor inspects every Set-Cookie header of the audited URL and reports one finding per cookie and attribute.

How it works

  1. Fetch — sends a HEAD request (or GET when HEAD is not supported) to the audited URL as 37AuditsBot. A blocked request ends the audit with 590; any other failure (timeout, DNS, TLS, or an HTTP status of 400 or more) ends it with 500.
  2. Parse — reads every Set-Cookie header in order and parses each one once into its name, value and the Secure, HttpOnly, SameSite, Domain, Path and Expires attributes (attribute names are case-insensitive).
  3. Rules — every rule runs over the whole list and emits one check per offending cookie, naming the cookie in the message, the recommendation and the check data. A cookie without HttpOnly (400) or with SameSite=None but no Secure (401) fails. A missing (300) or unknown (301) SameSite, a cookie set over HTTPS without Secure (302), a Domain without a dot (303), a Path that does not start with / (304) and an empty Set-Cookie header (305) warn.
  4. Aggregate — FAIL wins over WARNING; when no cookie triggers any rule, or the page sets no cookie at all, the audit is SUCCESS (200) and the message lists the cookie names.
  5. Specification pin — every run emits 37A-CookieAuditor-100 (INFORMATION), naming RFC 6265, HTTP State Management Mechanism (April 2011) and noting that SameSite comes from draft-ietf-httpbis-rfc6265bis. It does not change the overall status.

What it audits

Every row maps to one checkRule* method and one CheckCode, in the order the auditor runs them. CheckCode suffixes use status ranges: 100 information, 200 success, 300–399 warning, 400–499 fail, 500–599 error. Per-cookie rules emit one check per offending cookie; {name} is the cookie name and {url} the audited URL.

Output documentation

Each per-cookie check carries cookieName, secure, httpOnly, sameSite, domain, path, expires (the parsed value or null) and attribute (the attribute the rule is about) in its data; the empty-header check adds position. The 200 check carries cookieCount and cookieNames.

Risks and considerations

  • A session cookie readable by JavaScript is the first thing a cross-site scripting payload exfiltrates; HttpOnly makes it invisible to scripts.
  • Without Secure, the same cookie is sent when anything on the page or a visitor’s typed address falls back to http://, where it can be read on the network.
  • SameSite decides whether the cookie accompanies requests started by other sites, which is what cross-site request forgery relies on. Browsers default differently when it is missing, so an explicit value gives every visitor the same protection.

Severity

  • A missing HttpOnly and a SameSite=None without Secure fail; browsers reject the latter outright, so the feature that depends on it breaks.
  • A missing Secure on HTTPS is a warning: many frameworks add it automatically behind a proxy, but confirm it reaches the browser.
  • Cookies that must be read by page scripts (a CSRF token for a JavaScript client, a theme preference) legitimately lack HttpOnly. The auditor cannot tell them from session cookies, so review the finding for each cookie name.

Behavior changes from the previous version

  • A network error or an HTTP status of 400 or more on the audited page is now ERROR (500), not FAIL: it means the audit could not run, not that the site is wrong.
  • HttpOnly stays a FAIL and Secure stays a WARNING, as before.
  • Each finding now carries a CheckCode, the cookie name and a recommendation; findings are no longer keyed by the raw Set-Cookie string.

What this auditor does not check

  • Only the audited URL is fetched, with a HEAD (or GET) request and no login: cookies set after sign-in, by other pages or by JavaScript (document.cookie) are not seen.
  • Expires and Max-Age are recorded but not judged; cookie lifetime is a policy decision.
  • Cookie prefixes (__Host-, __Secure-) and the Partitioned attribute are not validated.
  • A Domain with a leading dot is accepted; modern browsers ignore the dot.