Auth tokens are not passed in URL parameters
Why it matters
Auth tokens placed in URL query parameters (CWE-598, CWE-200) are automatically recorded in browser history, server access logs, proxy logs, and the HTTP Referer header sent to any third-party resource on the next page. A token that lives in a URL has already been logged somewhere beyond your control. OWASP A02 (Cryptographic Failures) covers sensitive data exposure through insecure transport, and OWASP ASVS V7 Session Management explicitly disallows placing session identifiers in URL query strings; a token visible in a URL is effectively broadcast to every system the request passes through.
Severity rationale
High because URL-embedded tokens are passively harvested from server logs and Referer headers without any active attack against the user.
Remediation
Move every persistent auth token out of URLs and into request headers:
// Use the Authorization header, not a query string
const response = await fetch('/api/data', {
headers: { Authorization: `Bearer ${token}` }
})
// Never do this:
const response = await fetch(`/api/data?token=${token}`)
For server-to-server calls, use an Authorization header or a dedicated custom header like X-API-Key. The only accepted exception is a one-time-use, short-lived token in an email link (password reset, email verification) — but even these should expire within 1 hour and be invalidated immediately on first use.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Authentication Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-598 — Use of GET Request Method with Sensitive Query Strings
- cwe · CWE-200 — Exposure of Sensitive Information to an Unauthorized Actor
- owasp:2021 · A02
- soc2:2017 · CC6.7 — Restriction of information transmission, movement, and removal
Taxons
History
- 2026-04-18·v1.0.0·Initial import from saas-authentication·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.7) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2