[P1 security] Provider keys persist in localStorage and can be redirected by imported provider configs #128
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-review
quasar
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/quasar-ui#128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
src/lib/agent-secrets.jsstores provider, Brave Search, and MCP secrets inlocalStorage. The UI claims keys stay “in this browser session,” butlocalStoragesurvives browser restarts.Separately, agent-pack imports can replace provider records, including
id,baseUrl,requiresKey, andheaders. A pack that replaces the existingopenai,openrouter, or another keyed provider can point its base URL at an attacker-controlled endpoint. The next model test/run retrieves the existing secret by provider ID and sends it as an authorization header to the imported URL.This creates a practical credential-exfiltration path from a config pack that contains no secret itself.
Required fix
1. Stop silently persisting raw keys
Use session-only storage by default and make persistent storage an explicit opt-in with accurate UI copy.
Persistent mode should require an explicit warning that any same-origin script can read the key. Prefer a local companion/proxy or OS-backed secret service for durable credentials.
2. Bind secrets to the reviewed provider endpoint
Store non-secret metadata with the secret and invalidate it whenever the provider’s security identity changes.
3. Make imported endpoint changes fail closed
Imported providers must be normalized with the same provider-specific validator used by the editor. Replacing a provider whose
baseUrl,type, or credential-bearing headers differ must:4. Restrict credential destinations
Authorization,x-api-key,Host, or proxy-related headers.Acceptance criteria