Skip to content

[P0/security] Statements carrying credentials are stored in history verbatim #587

Closed

Description

@EVWorth

Context

historyStore persists entry.sql exactly as executed.

Problem

CREATE USER ... IDENTIFIED BY 'hunter2', ALTER USER ... IDENTIFIED BY, SET PASSWORD = ... and GRANT ... IDENTIFIED BY all carry a plaintext password in the statement text. Today those run from the admin panel and are not recorded at all — but the moment history covers app-generated SQL (see the coverage issue), every password set through the UI lands in localStorage in the clear. Typing the same statement in the editor already does this now.

The app is otherwise careful here: passwords live in the OS keyring and are #[serde(skip_serializing)] so they never cross the IPC boundary. Writing them to history in plaintext undoes that.

Most competing clients do store these verbatim. This is a place to be better, not to match.

Expected

Before an entry is stored, credential-bearing clauses are replaced with a marker — IDENTIFIED BY <redacted>. Redaction happens on the way in, so nothing sensitive is ever written, and applies regardless of origin. The executed statement is untouched; only the recorded copy is redacted, and the entry says it was.

Notes

Narrower and non-optional compared to #330, which asks for general literal scrubbing as a user preference. This one should not be a preference.

Acceptance

Running CREATE USER 'x'@'%' IDENTIFIED BY 's3cret' from the editor leaves no occurrence of s3cret in the persisted history; the user is still created; the entry shows the redacted form and is marked redacted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/historykind/securityseverity/p0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions