Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
URLs are logged everywhere (web server logs, reverse proxies, browser history, referrer headers leaking to third-party CDNs and ad networks), so this leaks the credential.
Pass session ids/tokens in the Authorization header or in a Secure; HttpOnly cookie. Never in the URL.
// ok: auth.session.id-in-url -- regular query strings, no credentialsexport const goodLink = '/api/profile?include=settings';// ok: auth.session.id-in-url -- Authorization header is the right placeexport function fetchWithAuth(url: string, token: string) { return fetch(url, { headers: { Authorization: `Bearer ${token}` }, });}
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.