Skip to content

#3832: multilingual credential names and PII region packs - #3852

Merged
squid-protocol merged 3 commits into
mainfrom
claude/gitgalaxy-tours-globe-hs3tmf-3832
Sep 27, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
claude/gitgalaxy-tours-globe-hs3tmf-3832

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3832

What changed

Credential names (security_lens.hardcoded_secrets). The signature only knew English names (password|secret|token|api_key… and the COBOL PASSWORD|SECRET|TOKEN|KEY|CREDENTIALS). The names now come from a new leaf module, gitgalaxy/security/credential_lexicon.py, which imports only re, so it can't create an import cycle:

  • the English core, unchanged;
  • German passwort/kennwort, Portuguese senha, Spanish contraseña/contrasena/clave, French mot_de_passe (COBOL MOT-DE-PASSE), Dutch wachtwoord, Swedish lösenord/losenord, Norwegian passord, Danish adgangskode, Finnish salasana, Polish hasło/haslo.

The shape guards are unchanged: a 16+ character literal for the identifier form, and a VALUE literal for the COBOL form. So clavel = "…" and senha = "short" still don't fire.

The literal gate still derives. hasło is spelled as two whole words rather than has(?:l|ł)o so the gate doesn't pick up the near-universal literal has. The gate tests (one-sided, gated == ungated) pass.

PII region packs (pii_leak_hunter). The hunter only knew the US SSN. National identifiers now come in region packs (PII_REGION_PACKS), all on by default and narrowed with --regions us,iban,…. Cards and AWS keys are always on.

pack identifier guard against ordinary numbers
us SSN shape (unchanged)
iban IBAN (any country) ISO 13616 mod-97
uk NINO HMRC prefix/suffix letter rules
in Aadhaar Verhoeff check digit; one consistent separator
br CPF both mod-11 check digits; repeated digits rejected
nl BSN 11-proof and BSN/burgerservicenummer/sofinummer on the line

A pattern hit counts only when its validator accepts it. Each identifier is masked to its last four characters (IBAN-MASKED-3000, CPF-MASKED-4725, …). The clean-scan message now names the new categories. The tool README and the wiki page are updated.

Verification

  • Full suite (pytest tests/): 12198 passed, 34 skipped, 9 xfailed, 3 xpassed.
  • tests/tools/crucible_check.py: PASS in both modes, no golden-master change. Nothing needed re-blessing: no crucible file uses a new credential name in a secret shape.
  • tests/ruff_audit.py --ci, tests/mypy_audit.py --ci: no new findings.
  • tests/tools/unicode_gauntlet.py --corpus keyword-rosetta --ci: exit 0 (557/934 cells, no regression against the baseline).
  • New tests:
    • 14 non-English positives (identifier and COBOL forms) and 3 shape-guard negatives;
    • 18 parametrised region-pack cases (valid, checksum-failing, and unlabelled BSN);
    • masking, --regions selection, rejection of an unknown pack, and a linear-time check on pathological lines.

Environment note: tiktoken's cl100k_base file was loaded from a local cache so the full-precision venv could run. The cache was seeded from the tiktoken-offline wheel and checked against tiktoken's pinned SHA-256, because the sandbox proxy blocks openaipublic.blob.core.windows.net.

Not in scope: the per-language baseline rules in ada.py / yaml.py still carry the English-only list.

🤖 Generated with Claude Code

https://claude.ai/code/session_018whc9Ptg89vdP8tCsHGVhP


Generated by Claude Code

The hardcoded-secrets signature knew only English credential names, and the
PII leak hunter only the US SSN.

- security/credential_lexicon.py: a leaf lexicon of credential names (de, pt,
  es, fr, nl, sv, no, da, fi, pl beside the unchanged English core), in both
  the identifier form and the COBOL data-name form. security_lens builds the
  hardcoded_secrets regex from it; the shape guards (16+ char literal, COBOL
  VALUE clause) are unchanged.
- pii_leak_hunter: national identifiers in region packs (us SSN, iban, uk
  NINO, in Aadhaar, br CPF, nl BSN), all on by default, narrowed with
  --regions. Every pack a bare number could imitate carries a checksum
  validator (IBAN mod-97, Aadhaar Verhoeff, CPF mod-11, BSN 11-proof plus a
  label on the line); each is masked to its last four characters.

Closes #3832

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018whc9Ptg89vdP8tCsHGVhP
@squid-protocol squid-protocol added this to the GitGalaxy Tours the Globe milestone Sep 27, 2026 — with Claude
…s-globe-hs3tmf-3832

# Conflicts:
#	gitgalaxy/security/security_lens.py
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 2115fcf into main Sep 27, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the claude/gitgalaxy-tours-globe-hs3tmf-3832 branch September 27, 2026 00:55
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.

Security heuristics are English/US-only: credential names and PII patterns miss PASSWORT, SENHA, CONTRASENA, Aadhaar, IBAN, NINO, CPF

2 participants