Commit 19873ab
crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even though they
were not valid for the target hostname.
These changes affect the format of subject alternative names and the
format of authority information access. The checkServerIdentity function
has been modified to safely handle the new format, eliminating the
possibility of injecting subject alternative names into the verification
logic.
Because each subject alternative name is only encoded as a JSON string
literal if necessary for security purposes, this change will only be
visible in rare cases.
This addresses CVE-2021-44532.
Co-authored-by: Akshay K <iit.akshay@gmail.com>
CVE-ID: CVE-2021-44532
Backport-PR-URL: nodejs-private/node-private#306
PR-URL: nodejs-private/node-private#300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>1 parent d4e5d1b commit 19873abCopy full SHA for 19873ab
59 files changed
+2,429-42Lines changed: 2429 additions & 42 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- doc/api
- lib
- internal
- src
- test
- common
- fixtures
- keys
- x509-escaping
- google
- parallel
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+8Lines changed: 8 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1869 | 1869 | |
1870 | 1870 | |
1871 | 1871 | |
| 1872 | + |
| 1873 | + |
| 1874 | + |
| 1875 | + |
| 1876 | + |
| 1877 | + |
| 1878 | + |
| 1879 | + |
1872 | 1880 | |
1873 | 1881 | |
1874 | 1882 | |
|
Collapse file
+9Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
| 26 | + |
26 | 27 | |
27 | 28 | |
28 | 29 | |
| ||
323 | 324 | |
324 | 325 | |
325 | 326 | |
| 327 | + |
| 328 | + |
| 329 | + |
| 330 | + |
| 331 | + |
| 332 | + |
| 333 | + |
| 334 | + |
326 | 335 | |
327 | 336 | |
328 | 337 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1345 | 1345 | |
1346 | 1346 | |
1347 | 1347 | |
| 1348 | + |
| 1349 | + |
1348 | 1350 | |
1349 | 1351 | |
1350 | 1352 | |
|
Collapse file
+51-1Lines changed: 51 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
| 27 | + |
| 28 | + |
27 | 29 | |
28 | 30 | |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
29 | 36 | |
30 | 37 | |
31 | 38 | |
| 39 | + |
32 | 40 | |
33 | 41 | |
34 | 42 | |
| ||
207 | 215 | |
208 | 216 | |
209 | 217 | |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
210 | 257 | |
211 | 258 | |
212 | 259 | |
| ||
218 | 265 | |
219 | 266 | |
220 | 267 | |
221 | | - |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
222 | 272 | |
223 | 273 | |
224 | 274 | |
|
0 commit comments