Skip to content

[P1/security] History persists raw SQL with user-supplied values — no scrubbing/redaction #330

Closed

Description

@EVWorth

Context

SQLPilot is a desktop DB tool; users may paste session-bound values for debugging (e.g., SELECT * FROM users WHERE email = '[email protected]'). Every such query sits in localStorage (file-backed at Library/Application Support/com.sqlpilot.app/...) for the lifetime of the install.

Problem

If the user shares their machine or installs a backup tool, the history file leaks. Compare to the localStorage design in FR-9.1: data risk is "low" because the data is user's own queries, but a regulator in a healthcare/finance setting would flag it. The password storage is correctly keyring-backed but the same hygiene isn't applied to query content.

Files

  • src/stores/historyStore.ts:30-31
  • src/stores/resultStore.ts:181-219

Expected

A setting (default ON) to redact user-supplied values from history before persist. The SQL still runs as expected (redaction is post-execute, on the stored copy only).

Proposed fix

Scope M — add a setting (default ON) to "Redact known-sensitive values in history" that scrubs `WHERE col = '...' literal values before persist; add an "Export history" / "Wipe history older than N days" affordance to the clear-history flow.

Acceptance

A query SELECT * FROM users WHERE email = '[email protected]' saved with redact-on renders as SELECT * FROM users WHERE email = '***' in the history panel; the SQL still runs as expected.

Needs human verify

yes

Activity

  1. added
    audit
    severity/p1
    kind/security
    area/history
    on Jul 31, 2026
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/historyauditkind/securityseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions