Skip to content

redactSqlLiterals: SQL Server [..] identifiers, Oracle q'..' quoting and number-glued-to-keyword still leak #148

Closed

Description

@krassx

Follow-up to #109 / PR #140 (found by a fresh review of the tokenizer; all pre-existing, the old regex leaked them too).

  • SELECT [it's] FROM t WHERE a = 'secret1' AND b = 'x' -> SELECT [it?secret1?x?
  • SELECT q'[O'Brien secret2]' FROM dual -> SELECT q?Brien secret2]?
  • BigQuery triple quotes '''it's secret'''
  • SELECT * FROM t WHERE ssn=123456789AND x=1 keeps the number (\b treats it as one word).

Fix options: a fourth dialect reading (brackets, q-quotes) or fail closed on a quote inside [..] and on q'; widen the number rule. The current behaviour is pinned by a test in span-sanitizer.test.ts.

Activity

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