Commit 2dd5134
committed
fix: stop no-dash SSN branch matching digit runs inside hex IDs
A bare nine-digit run embedded in a longer alphanumeric token (random
hex IDs, UUID segments) matched the SSN pattern because its boundaries
only excluded adjacent digits. In practice this let randomly generated
server IDs trip the Claude Code PII firewall hook and block entire
sessions.
Tighten the no-dash branch only: the run must not be followed by a
letter, and must start at a non-alphanumeric boundary or right after a
two-letter token prefix (preserving v4.4.0 country-code parity, e.g.
DE123456789). The dashed branch keeps its existing boundaries.1 parent 60fa5fd commit 2dd5134
2 files changed
Lines changed: 33 additions & 2 deletions
File tree
- datafog/processing/text_processing/regex_annotator
- tests
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | | - | |
110 | 115 | | |
| 116 | + | |
111 | 117 | | |
| 118 | + | |
112 | 119 | | |
| 120 | + | |
113 | 121 | | |
| 122 | + | |
114 | 123 | | |
115 | | - | |
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
376 | 399 | | |
377 | 400 | | |
378 | 401 | | |
| |||
0 commit comments