CVE-2026-6731 - wolfSSL X.509 commonName name-constraint bypass
CVE-2026-6731 - wolfSSL X.509 commonName name-constraint bypass - High - 2026-06-25
Business risk: A constrained CA can issue a certificate whose commonName escapes intended DNS constraints and is still accepted by clients.
Root cause: Subject commonName is evaluated as a DNS-type name without applying name constraints consistently.
Affected versions
- Vulnerable: wolfSSL releases before the vendor fix when Subject CN is treated as a DNS name under constrained CAs.
- Fixed / safe target: Upgrade to the wolfSSL release containing PR 10223 or later and prefer SAN-based hostname validation.
- CVSS: 7.5 (High)
Exact vulnerable code pattern
wolfSSL_CTX_load_verify_locations(ctx, "constrained-ca.pem", NULL);
wolfSSL_check_domain_name(ssl, requested_host);
Fixed / mitigated code pattern
wolfSSL_CTX_load_verify_locations(ctx, "constrained-ca.pem", NULL);
wolfSSL_check_domain_name(ssl, requested_host);
set_policy_reject_cn_only_dns_identities(true);
Step-by-step integration guide
- Inventory wolfSSL packages, vendored source, submodules, and embedded SDKs.
- Upgrade to the vendor-fixed build and rebuild static consumers.
- Add protocol regression/fuzz coverage for the affected path.
- Deploy patched firmware/images and retire vulnerable artifacts.
- Document temporary network controls used during rollout.
Alternative mitigations
- Block untrusted traffic to affected protocol endpoints.
- Disable the affected protocol feature where possible.
- Run affected services with process sandboxing and rate limits.
Detection signature
rg -n "wolfSSL|WOLFSSL_VERSION|libwolfssl|DTLS|ALPN|SNI|X509" .
Copy-paste skill block
Model context: this prompt was generated by GPT 5.5 Extra High reasoning.
Remediate CVE-2026-6731: wolfSSL X.509 commonName name-constraint bypass.
Required output:
- A reviewer-ready PR with dependency/config/code changes, tests, and deployment notes; or
- TRIAGE.md if the affected runtime is outside this repository.
Steps:
1. Confirm exposure using the detection signature above.
2. Apply the fixed or mitigated pattern.
3. Add or run a regression test for the exploit shape.
4. Record commands, versions, and residual risk in the PR body.
Boundaries:
- Scope only CVE-2026-6731 and directly related hardening.
- Do not run destructive exploit payloads against production.
- Preserve existing behavior except for the vulnerable path.
Tags and revenue routing
- Keywords: cve, wolfssl, tls, c, memory-safety, sellable_to_iot, zero_day_gold, high
- Affected tech stack: c/cpp
- Revenue tags: sellable_to_iot, zero_day_gold