Repository navigation
fix(sanitizer): redact IBAN bank account numbers (TSK-009) - #108
Merged
Merged
Conversation
Add an IBAN redactor that matches compact and space-grouped IBANs and redacts them as [REDACTED_IBAN] only when the ISO 13616 mod-97 checksum holds. It runs right after emails, before card, document, phone and SSN rules, so grouped digits are not partially consumed. Document IBANs in the SPECS sanitization section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
🤖 hustle review: approve — IBAN redactor regex and mod-97 checksum are correct, pipeline order matches the task, all four acceptance criteria are covered by tests, and docs and backlog are updated consistently. |
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 22, 2026
## [4.1.7](v4.1.6...v4.1.7) (2026-11-22) ### Bug Fixes * **sanitizer:** redact IBAN bank account numbers (TSK-009) ([#108](#108)) ([e44ae25](e44ae25))
Contributor
|
🎉 This PR is included in version 4.1.7 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sanitizehad no rule for bank account numbers, so IBANs in prompts, commands or tool output reached theReportunredacted, even thoughdocs/SPECS.mdsays personal identifiers are redacted (RPT-009 / TSK-009).What changed
src/core/sanitizer.ts: newredactIBANs+passesIbanChecksum.[REDACTED_IBAN]only when it is 15–34 characters long and the ISO 13616 mod-97 checksum equals 1. Letters map to 10–35 and the remainder is folded digit by digit, so no BigInt is needed. Uppercase reference codes that fail the checksum stay readable.redactEmails, before cards, document numbers, national IDs, SSN and phone rules. Without that order, those rules could take some of the grouped digits.src/core/sanitizer.test.ts: newIBAN bank account numbersblock with 7 cases.docs/SPECS.md: the sanitization section now lists IBANs and says they are redacted only when the checksum holds..backlog/: TSK-009 moved to complete with evidence, plus learning LRN-008.Acceptance criteria
ES9121000418450200051332,GB82WEST12345698765432). Evidence:pnpm vitest run src/core/sanitizer.test.ts -t IBANasserts the exact outputTransfer to [REDACTED_IBAN] todaywithredacted === 1. These tests failed before the change and pass now.ES91 2100 0418 4502 0005 1332,DE89 3704 0044 0532 0130 00). Evidence: the same run assertsIBAN: [REDACTED_IBAN]., so the trailing period is kept and nothing is left over. These tests also failed before and pass now.ES9221000418450200051332,GB83WEST12345698765432,DE89 3704 0044 0532 0130 01). Evidence: tests assert that no[REDACTED_IBAN]appears for them.src/core/sanitizer.test.ts, andpnpm check && pnpm testpass. Evidence:pnpm checkexits 0 (tsc, eslint, prettier).pnpm testpasses 26 files / 489 tests.pnpm buildsucceeds.Verification
Run locally on Node 22 (the version in
.nvmrc):🤖 Generated with Claude Code