crypto: harden X.509 conversion and formatting · nodejs/node@4b3c9bb · GitHub
Skip to content

Commit 4b3c9bb

Browse files
panvamcollina
authored andcommitted
crypto: harden X.509 conversion and formatting
Check X.509 ASN.1, BIO, time, OID, and DER conversion results. Preserve invalid-time diagnostics, reject incomplete BIO writes, format RSA exponents atomically, and avoid truncating long object identifiers. Preserve valid siblings in legacy name objects by omitting individual non-text AttributeValues. Continue treating structural failures and failed conversion of supported string types as conversion failures. Reject empty or malformed SAN and AIA extensions, and prevent TLS hostname checks from falling back to commonName after a malformed SAN. Guard missing public keys and non-NIST curve names. Scope fallible backend probes without consuming callback errors, parse checkIP() inputs to exact address bytes, and preserve unrelated backend errors. Refs: https://hackerone.com/reports/3910015 Refs: https://hackerone.com/reports/3824331 Refs: https://hackerone.com/reports/3944830 Refs: https://hackerone.com/reports/3944847 Assisted-by: Codex Co-authored-by: Matteo Collina <hello@matteocollina.com> Signed-off-by: Matteo Collina <hello@matteocollina.com> Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: nodejs-private/node-private#1007 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 9243b10 commit 4b3c9bb

8 files changed

Lines changed: 1072 additions & 200 deletions

File tree

‎deps/ncrypto/ncrypto.cc‎

Lines changed: 322 additions & 153 deletions
Large diffs are not rendered by default.

‎deps/ncrypto/ncrypto.h‎

Lines changed: 42 additions & 8 deletions

‎src/crypto/crypto_x509.cc‎

Lines changed: 121 additions & 26 deletions

0 commit comments

Comments
 (0)