Skip to content

[Security] Sensitive Credential Exposure via URL and localStorage #3

@daniel-yfc

Description

@daniel-yfc

[Security] Sensitive Credential Exposure via URL and localStorage

Description:
Sensitive credentials are being handled insecurely:

  1. getTokenFromUrl() reads tokens from ?auth_token= or ?token=.
  2. geminiService.ts stores API keys in plaintext within localStorage.

Impact:

  • Tokens in URLs are leaked through browser history, logs, and Referer headers.
  • API keys in localStorage are vulnerable to XSS attacks.

Proposed Solution:

  • HA Token: Transition to Home Assistant’s native hass object/Auth provider. Remove URL parsing logic.
  • Gemini Key: (Short-term) Move to sessionStorage with a UI warning. (Long-term) Implement a serverless proxy to hold the key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions