Repository navigation
fix(performance): redactSqlLiterals reads [..], q'..' and triple-quoted bodies; redacts glued numbers - #156
Conversation
…bodies; redacts glued numbers Fixes #148 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hape losses Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @krassx's task in 1m 24s —— View job Review of PR #156:
|
| Sev | Location | Summary |
|---|---|---|
| P3 | span-sanitizer.ts:243-254 (inline) |
The [..] reading uses SQL Server's ]] escape, so Postgres a[b[1]] and ARRAY[[1,2],[3,4]] cut the tail. This is not listed with the other accepted shape losses. |
I found no leaks. Both probes above fail closed, as the PR intends. A [..] run holding a quote, a q-quote or triple-quote body with an embedded quote, an unterminated run, a \-delimited q-quote, a raw triple string ending in \''', and 123-45-6789AND all came out with the secret redacted or the tail cut. Positional params ($1 → $?) and IN (1,2,3) LIMIT 10 are unchanged.
I also checked the trailing-\b removal in the number regex. Leading \b still protects col12, _3 and t.c4. The 1..2 change (?..? → ?.?) is only cosmetic, and the test is updated for it.
Summary
- Overall risk: Low
- Merge recommendation: Approve once the P3 note is addressed. Either document the nested-
]]loss or fix it. It isn't blocking, because it fails on the safe side. - Most important issue: the nested-bracket shape loss above. Postgres users of
@opentelemetry/instrumentation-pgmay see truncated statements fora[b[1]]andARRAY[[..],[..]]. - Positives:
- The new dialects are readings that must agree or the tail is cut, which fits the existing fail-closed design.
- The accepted losses are pinned in a test.
- The randomised statement fuzz uses a properly distributed PRNG.
- Making the glued-number rule greedy closes a real leak (
123456789AND).
· Branch:fix/issue-148
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Addressed the P3 nested-bracket note by documenting and pinning the loss (accepted fail-closed shape loss, now in the shape-loss test). Depth counting was rejected: it would need a rule for |
|
Claude finished @krassx's task in 1m 0s —— View job Re-review of PR #156 after the latest push (
|
Fixes #148
Adds three dialect readings to the fail-closed tokenizer (SQL Server
[..], Oracleq'..'/nq'..', BigQuery triple quotes); a quote inside them now makes the readings disagree and the tail is cut instead of shifting the pairing. The numeric rule no longer needs a trailing word boundary, so123456789ANDis redacted.Accepted shape losses (fail-closed, pinned by a test):
ARRAY['a']/data['k']cut at the bracket, a string starting with''+ quote reads as a triple quote, hex-digit keyword letters / digit-led words are eaten by the number rule.Verification: mutator loop on every changed branch (one equivalent survivor: backslash handling in the triple scan is unobservable because the MySQL/standard readings cut first); randomised well-formed-statement fuzz across all dialect constructs (mulberry32); 100% line coverage, 98.9% branch on the file; one fresh Opus review round (all findings addressed or pinned).
🤖 Generated with Claude Code