Commit 7a09a16
Security: reject Plane 1-3 supplementary noncharacters in local parts
Unicode §23.7 permanently reserves U+nFFFE and U+nFFFF for every plane
(n=1..16) as noncharacters forbidden in open interchange. The explicit
scalar guards covered Planes 4-13 (U+40000-U+DFFFF) and SSP/PUA
(U+E0000+), but missed the six noncharacters in Planes 1-3:
U+1FFFE/U+1FFFF (SMP), U+2FFFE/U+2FFFF (SIP), U+3FFFE/U+3FFFF (TIP).
Add explicit value checks for all six in extractDotAtom and the
extractQuotedString inline guard. Fix the incorrect XCTAssertNotNil for
U+3FFFF (a §23.7 noncharacter, not an assigned scalar). Add
testSupplementaryNonCharactersPlanes1Through3RejectedInLocalPart to
cover all six values plus boundary confirmation that U+1FFFD, U+2FFFD,
and U+3FFFD remain accepted.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 52c845a commit 7a09a16
2 files changed
Lines changed: 61 additions & 3 deletions
File tree
- Sources/SwiftEmailValidator
- Tests/SwiftEmailValidatorTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
418 | 421 | | |
419 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
420 | 426 | | |
421 | 427 | | |
422 | 428 | | |
| |||
465 | 471 | | |
466 | 472 | | |
467 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
468 | 477 | | |
469 | 478 | | |
470 | 479 | | |
| |||
Lines changed: 51 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1133 | 1133 | | |
1134 | 1134 | | |
1135 | 1135 | | |
1136 | | - | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1137 | 1139 | | |
1138 | 1140 | | |
1139 | | - | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1140 | 1189 | | |
1141 | 1190 | | |
1142 | 1191 | | |
0 commit comments