Skip to content

Addresses vulnerabilities #752 and #738 by migrating API key storage from localStorage to sessionStorage to prevent XSS exposure #773

@sujal111

Description

@sujal111

Discussion 🗣
Context
This issue addresses security vulnerabilities #752 and #738 related to API key storage exposure via XSS attacks. The current implementation uses localStorage, which persists indefinitely and can be accessed by malicious scripts injected via XSS.

Detailed Description
Problem: API keys encrypted with WebAuthn PRF are stored in localStorage, making them accessible to XSS attacks despite encryption. While decryption requires the WebAuthn credential, the encrypted data itself is vulnerable to theft or tampering.
Solution: Migrate encrypted API key storage from localStorage to sessionStorage. This limits data persistence to the current browser session, reducing the attack window as sessionStorage is cleared when the tab is closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions