fix(security-scanner): use truncateUtf16Safe for evidence truncation#102720
fix(security-scanner): use truncateUtf16Safe for evidence truncation#102720zhangqueping wants to merge 1 commit into
Conversation
Replace raw UTF-16 slice in truncateEvidence with truncateUtf16Safe to prevent surrogate pair splitting in skill security scan findings. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 7:32 AM ET / 11:32 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. Current main's Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow scanner truncation change after contributor proof is added; a focused scanner regression for well-formed evidence would further strengthen the fix. Do we have a high-confidence way to reproduce the issue? Yes. Current main's Is this the best way to solve the issue? Yes. Reusing the existing UTF-16-safe helper at the local scanner evidence truncation point is the narrow maintainable fix; proof and preferably a focused scanner regression are the remaining confidence gaps. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 34d257713ea3. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1. Total +1 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Thanks @zhangqueping. #102823 landed the same UTF-16-safe security-scanner evidence cap in |
What Problem This Solves
The skill security scanner uses a raw UTF-16 code-unit slice to truncate finding evidence at 120 characters. An emoji crossing the boundary could produce an unpaired surrogate in scan reports.
Why This Change Was Made
Replace
.slice(0, maxLen)withtruncateUtf16SafeintruncateEvidence. The existing default limit and ellipsis suffix remain unchanged.Files Changed
src/skills/security/scanner.ts.slice(0,N)withtruncateUtf16SafeintruncateEvidence.🤖 Generated with Claude Code