Skip to content

[P1/security] Favorites persist raw SQL with user-supplied values — no scrubbing/redaction #339

Closed

Description

@EVWorth

Context

addFavorite (src/stores/favoritesStore.ts:80-95) writes the raw SQL string to localStorage; SaveFavoriteDialog.tsx:39-49 passes raw sql in.

Problem

Same as history F8 — favorites are a more curated subset of queries, but they still contain user values. A favorite like SELECT * FROM users WHERE email = '[email protected]' (saved while debugging) persists forever. The favorites file is the user's "library of useful queries", which is more likely than history to contain production queries with literal data.

Files

  • src/stores/favoritesStore.ts:80-95
  • src/components/favorites/SaveFavoriteDialog.tsx:39-49

Expected

With redact-on enabled, a favorite saved with WHERE email = '[email protected]' shows WHERE email = '***' in the sidebar; the SQL still runs as expected when loaded into the editor.

Proposed fix

Scope M — gate on the same redactHistory setting as history F8 (rename to redactPersistedSql to cover both). This is a single setting that affects both stores. Alternative: just give favorites a "This favorite contains sensitive values" checkbox that the user toggles to enable redacting on save.

Acceptance

A favorite saved with WHERE email = '[email protected]' shows WHERE email = '***' in the sidebar; the SQL still runs as expected when loaded into the editor.

Needs human verify

yes

Activity

  1. added
    audit
    severity/p1
    kind/security
    area/favorites
    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/favoritesauditkind/securityseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions