Skip to content

ScrubQueryText leaves sql comments unchanged which may leak sensitive information #54

Closed

Description

@abhiraj-ku

the function "ScrubQueryText" removes quoted literals, emails, UUIDs, and numbers, but it does not remove sql comments. Sensitive values inside comments may therefore remain in query text sent to model context

Activity

  1. lofoneh commented on Sep 18, 2026

    @lofoneh
    Contributor

    Confirmed — pg_stat_statements keeps comments verbatim even when it normalizes the literals, so a comment like /* api_key=… */ reaches --json, MCP, the report and the AI prompt. I have a fix ready (a small comment lexer ahead of the existing scrub, plus a fuzz invariant) and will open a PR shortly.

  2. abhiraj-ku commented on Sep 19, 2026

    @abhiraj-ku
    Author

    hey @alexshapalov , should we add a local scrub command so we can verify how query is sanitized before entering the context . i can work on that

  3. added a commit that references this issue on Sep 22, 2026
    a3479a2
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions