LibreChat/packages/api
Claude 32d5986923
fix: Reject placeholder-bearing admin keys from shared backfill
Codex round three P1, verified end-to-end before fixing: processMCPEnv
injects an admin `apiKey.key` into the request headers (env.ts:448)
BEFORE header values get per-user placeholder resolution (env.ts:478),
so a key like `{{LIBRECHAT_OPENID_ACCESS_TOKEN}}` makes the connection
identity-scoped — while `placeholderBearingFields` never inspects
`apiKey.key` and the gate rejected only `source: 'user'`. Instructions
fetched under one user's identity could then be stored for everyone.

The gate now scans the admin key value with the same runtime-placeholder
predicate. Kept narrow deliberately: widening
`placeholderBearingFields` itself would change
`requiresUserScopedConnection` for every caller — connection pooling
included — which is its own decision.

Static admin keys still backfill (positive control test); both new
refusal tests verified red without the gate change. Suite 39/39.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SxKWxwqxAGckYpRsYTqx3F
2026-08-30 19:32:21 +00:00
..
src fix: Reject placeholder-bearing admin keys from shared backfill 2026-08-30 19:32:21 +00:00
types
.gitignore
babel.config.cjs
jest.config.mjs
jest.setup.cjs
package.json 📦 chore: bump @librechat/agents to v3.7.8 (#15337) 2026-08-29 16:17:15 -04:00
tsconfig-paths-bootstrap.mjs
tsconfig.build.json
tsconfig.json 🥸 chore: Resolve Agents SDK Path Aliases That Masked Backend Types (#15160) 2026-08-24 08:38:30 -04:00
tsconfig.spec.json
tsdown.config.mjs