Skip to content

fix(redaction): mask cards, IBANs, OTPs, localized password keys, IPv6 zones and seed phrases - #23

Open
Cyro292 wants to merge 28 commits into
mainfrom
fix/mcp-gap-vectors
Open

Cyro292 wants to merge 28 commits into
mainfrom
fix/mcp-gap-vectors

Conversation

@Cyro292

@Cyro292 Cyro292 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Fixes the misses that mobilerun-mcp#52 recorded only on its side. Each class is now either fixed here or listed as a limit in the package. Linear: DRO-4114, INT-46.

What changes ({ mode: 'strict', pii: true })

Input 0.4.1 Now
4111 1111 1111 1111 unchanged [REDACTED:card]
DE89 3704 0044 0532 0130 00 DE89 3704 [REDACTED:phone] 00 [REDACTED:iban]
004915123456789, 0151 23456789 unchanged [REDACTED:phone]
482913 is your login code unchanged [REDACTED:otp] is your login code
Your code: 4821 unchanged Your code: [REDACTED:otp]
Passwort=geheim123 unchanged Passwort=[REDACTED:generic-keyword]
mnemonic: abandon ability able about … unchanged mnemonic: [REDACTED:mnemonic]
fe80::1%en0 unchanged [REDACTED:ip]

These stay visible: RNG seed=1234 caused the crash, Invoice code: 482913, HTTP error: Code: 482913, G-20261202 is your Google code, error code 404, and Luhn- or mod-97-invalid numbers.

Rules

  • New pii rules: card (Luhn) and iban (mod-97). A valid IBAN inside an invalid envelope is still found, and IBANs no longer produce partial phone hits.
  • phone: 00-prefixed and German national formats. ip: IPv6 zone IDs. otp: code labels before or after the value, in several languages, with date-shape and compound-label exclusions.
  • Localized password keys (passwort, kennwort, contraseña, mot de passe, …), with NFC and case mapping, in text and JSON.
  • New standard-tier mnemonic rule: keyed values (mnemonic, seed phrase, …; a bare seed only with leading BIP39 words), BIP39 runs of a supported length, and checksum-valid windows inside longer runs. Keyed values stop at structural delimiters. The BIP39 English wordlist (MIT) is added to THIRD_PARTY_NOTICES.

Behavior change: mnemonic runs in compat mode without pii too.

Still not caught

Listed in ts/README.md Limits and SPEC §15: nested or next-line values, triple-quoted and multiword values, prose credentials, URL-encoded assignments, standalone base64, scheme-less proxy credentials, SOCKS usernames and IDN emails.

Tests

  • Spec, TypeScript, Python and Go change together; there are 628 shared vectors.
  • Functional suites with timing tests excluded: TS 2,342, Python 2,838 and Go 2,771 pass. go vet, tsc, sync-spec --check and release-version --check are clean.
  • Scaling was probed per flagged input against main and matches it. The full timing gates were not rerun locally.

No version bump: per RELEASING.md, 0.4.2 ships in its own bump PR.

⚠️ Two test fixtures are still missing from this branch: go/testdata/attacks.json (9 new attack strings) and python/tests/test_golden.py (golden replay of the mnemonic windows). Secret-scanning push protection rejected them, because both files already contain fake key prefixes and an npm-style token. They need a normal git push with a reviewed bypass. Go scaling and Python golden CI fail until they land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant