Repository navigation
🐛 fix(sanitize): strip nF intermediate-byte ESC sequences - #417
Conversation
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Mutation report (advisory)Mutation score: 75.06% (608 detected / 810 valid mutants). Report-only; this never fails CI.
Surviving mutants
|
There was a problem hiding this comment.
Read src/sanitize.ts at b049860 end to end. Looks correct to me.
- The new rule
/\x1b[ -/]+[0-~]/(src/sanitize.ts:60) is exactly the ECMA-35 nF shape: intermediates 0x20–0x2F, final 0x30–0x7E. - Ordering is right: it runs after the charset rule at
:56(soESC ( Bis still consumed there) and before the generic two-byte rule at:62, which could otherwise never match an intermediate as its second byte. CSI/OSC/DCS/APC/PM introducers ([,],P,_,^) are all outside 0x20–0x2F, so none of the earlier string-form rules are shadowed. - The
'\x1b(xq' → ' q'test case covers the exact leak #416 reported ((xnot matching[A-Z0-9], so it fell through to the ESC-only sweep).
Matches the scope of #416; changelog entry and docblock updated with it.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
ECMA-35 nF sequences (ESC + intermediates 0x20-0x2F + final) such as ESC # 8, ESC % G, ESC SP F matched neither the charset rule nor the generic two-byte rule, so only ESC was removed and the payload (#8, %G) leaked. Adds a rule before the generic one, with tests and changelog entry. Not built/tested locally per policy; CI is the verdict. Closes #416
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88