API key stored insecurely in localStorage — accessible to XSS and same-origin scripts #6
Labels
No labels
blocked:lint-failed
blocked:needs-decision
blocked:no-changes
blocked:verify-failed
bug
feature-request
quickfix
security/high
security/medium
test-coverage
triage-approved
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/GSD2_agent#6
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?
Severity: High
Files:
src/hooks/useWizard.tsx,src/lib/oauth.tsIssues:
1. API Key in localStorage (useWizard.tsx)
The entire
WizardState— includingapiKey— is serialized and stored in localStorage under keygsd-wizard-state. localStorage is accessible to any JavaScript running on the same origin. An XSS vulnerability anywhere in the app would expose the user's API keys.2. OAuth Token "Encryption" is XOR obfuscation (oauth.ts)
The
encryptTokensfunction uses:This is NOT encryption — it is trivially reversible XOR with a hardcoded key visible in the source code. Anyone with access to the browser or source can decrypt stored OAuth tokens.
Recommendations:
sessionStorage(already partially done for OAuth, but wizard state uses localStorage)