Skip to content

Commit 080ba13

Browse files
committed
deduped
1 parent 1a4bbd9 commit 080ba13

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

packages/core/src/utils/request.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,26 +153,23 @@ const SENSITIVE_HEADER_SNIPPETS = [
153153
* Extra substrings matched only against individual Cookie / Set-Cookie **names** (not header names),
154154
* so we can cover common session secrets that do not match {@link SENSITIVE_HEADER_SNIPPETS}
155155
* (e.g. `connect.sid` does not contain `session`) without false positives on arbitrary HTTP headers.
156+
*
157+
* Cookie names are checked with the same `includes()` list as headers plus these entries; omit redundant
158+
* cookie-only snippets that are already implied by a header match (e.g. `oauth` → `auth`, `id_token` → `token`,
159+
* `next-auth` → `auth`).
156160
*/
157161
const SENSITIVE_COOKIE_NAME_SNIPPETS = [
158162
// Express / Connect default session cookie
159163
'.sid',
160-
// PHP session cookie
161-
'phpsess',
162-
// Common opaque session id suffix / cookie names (e.g. ASPSESSIONID*, BIGipServer*)
164+
// Opaque session ids (PHPSESSID, ASPSESSIONID*, BIGipServer*, *sessid*, …)
163165
'sessid',
164166
// Laravel etc. "remember me" tokens
165167
'remember',
166-
// OAuth / OIDC auxiliary cookies
167-
'oauth',
168+
// OIDC / OAuth auxiliary (`oauth*` covered by header snippet `auth`)
168169
'oidc',
169170
'pkce',
170171
'nonce',
171-
// Explicit token-style cookie names
172-
'id_token',
173-
'access_token',
174-
'refresh_token',
175-
// RFC 6265bis cookie name prefixes for high-security cookies
172+
// RFC 6265bis high-security cookie name prefixes
176173
'__secure-',
177174
'__host-',
178175
// Load balancer / CDN sticky-session cookies (opaque routing tokens)
@@ -185,8 +182,6 @@ const SENSITIVE_COOKIE_NAME_SNIPPETS = [
185182
'firebase',
186183
'supabase',
187184
'sb-',
188-
// Auth.js / NextAuth.js
189-
'next-auth',
190185
// Step-up / MFA cookies
191186
'mfa',
192187
'2fa',

0 commit comments

Comments
 (0)