20260602-FPKI-DecodeGeneralName-URI#10578
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10578
Scan targets checked: wolfcrypt-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Findings: 2
Medium (2)
URI slash error path reads past payload
File: wolfcrypt/src/asn.c:18663
Function: DecodeGeneralName
Category: Logic errors
DecodeGeneralName() now enables this validator for WOLFSSL_FPKI, but the / path sets i = len inside the for; the loop increment makes i > len, so the later URI check reads past the GeneralName payload.
Recommendation: Return ASN_ALT_NAME_E immediately on /, or break using a separate malformed flag instead of mutating i.
Referenced code: wolfcrypt/src/asn.c:18663-18667 (5 lines)
ACERT URI slash error path reads past payload
File: wolfcrypt/src/asn.c:37745
Function: DecodeAcertGeneralName
Category: Logic errors
DecodeAcertGeneralName() now enables this validator for WOLFSSL_FPKI, but the / path sets i = len inside the for; the loop increment makes i > len, so the later URI check reads past the GeneralName payload.
Recommendation: Return ASN_ALT_NAME_E immediately on /, or break using a separate malformed flag instead of mutating i.
Referenced code: wolfcrypt/src/asn.c:37745-37749 (5 lines)
This review was generated automatically by Fenrir. Findings are non-blocking.
…e(), * don't disable URI validation when defined(WOLFSSL_FPKI). * return immediately with ASN_ALT_NAME_E when URI contains an unexpected '/', as in asn_orig.c DecodeAltNames(), fixing OOB read defect. wolfcrypt/src/asn_orig.c: fix URI validation gating (ignore WOLFSSL_FPKI) in DecodeAltNames(). tests/api/test_certman.c: fix uriSan in test_wolfSSL_X509_check_host_URI_SAN_not_DNS_match() (make it a URI). tests/api.c: align gating in test_wolfSSL_URI() with new dynamics (URIs validated regardless of defined(WOLFSSL_FPKI)).
0457204 to
768cdc3
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10578
Scan targets checked: wolfcrypt-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
|
retest this please |
wolfcrypt/src/asn.c: don't disable URI validation inDecodeGeneralName()andDecodeAcertGeneralName()whendefined(WOLFSSL_FPKI).tests/api/test_certman.c: fixuriSanintest_wolfSSL_X509_check_host_URI_SAN_not_DNS_match()(make it a URI).tests/api.c: align gating intest_wolfSSL_URI()with new dynamics (URIs validated regardless ofdefined(WOLFSSL_FPKI)).detected and tested with