CVE-2026-34580 Overview
CVE-2026-34580 is a certificate validation bypass vulnerability in Botan, a widely-used C++ cryptography library. The vulnerability exists in version 3.11.0 where the Certificate_Store::certificate_known function contains flawed logic that can allow an attacker to present a malicious end entity certificate that gets accepted as a trusted root certificate if its Distinguished Name (DN) and subject key identifier match those of any trusted root in the certificate store.
Critical Impact
An attacker can bypass certificate validation entirely by crafting an end entity certificate with a DN matching a trusted root, allowing the malicious certificate to be immediately accepted as trusted. This undermines the entire PKI trust model and enables man-in-the-middle attacks.
Affected Products
- Botan C++ Cryptography Library version 3.11.0
Discovery Timeline
- 2026-04-07 - CVE-2026-34580 published to NVD
- 2026-04-08 - Last updated in NVD database
Technical Details for CVE-2026-34580
Vulnerability Analysis
This vulnerability stems from a semantic mismatch between the certificate_known function's behavior and the assumptions made by the path validation logic introduced in version 3.11.0. The function was designed to check whether any certificate in the store has a matching DN (and subject key identifier, if set), but it does not verify that the certificate being checked and the stored certificate are actually identical.
When the path validation extension was implemented, developers assumed that certificate_known returning true meant the certificates were byte-for-byte identical. This incorrect assumption creates a critical gap where certificate chain validation can be completely bypassed.
The vulnerability is classified under CWE-295 (Improper Certificate Validation), which represents a fundamental failure in the cryptographic trust establishment process.
Root Cause
The root cause lies in the misleading semantics of the certificate_known function. The function performs a partial match based on DN and optional subject key identifier, but the newly extended path validation logic incorrectly assumed it performed a complete certificate comparison. When an end entity certificate's DN matches a trusted root's DN, the validation short-circuits and accepts the end entity certificate as if it were the trusted root itself.
Attack Vector
The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:
- Obtaining knowledge of a trusted root certificate's Distinguished Name (DN) and subject key identifier
- Crafting a malicious end entity certificate with matching DN and subject key identifier values
- Presenting this certificate during a TLS handshake or other certificate validation context
- The vulnerable Botan library will incorrectly accept this certificate as a trusted root
The vulnerability allows complete bypass of certificate chain validation, enabling attackers to impersonate any server or entity, intercept encrypted communications, and perform man-in-the-middle attacks without detection by the affected application.
Detection Methods for CVE-2026-34580
Indicators of Compromise
- Unusual certificate chains where end entity certificates claim root-level trust
- TLS connections established with certificates that have root-like DNs but are not actual trusted roots
- Certificate validation logs showing acceptance of certificates without proper chain verification
- Anomalous certificate presentations during handshakes where the certificate DN matches known trusted roots
Detection Strategies
- Monitor certificate validation events for certificates accepted without complete chain verification
- Implement additional certificate fingerprint verification independent of Botan's validation
- Deploy network monitoring to detect certificates with DNs matching trusted roots but different public keys
- Enable verbose logging in applications using Botan to track certificate validation decisions
Monitoring Recommendations
- Audit all deployed applications using Botan 3.11.0 for certificate validation functionality
- Implement certificate transparency monitoring to detect rogue certificates impersonating trusted entities
- Set up alerting for any certificate accepted as trusted that doesn't match known certificate fingerprints
- Review TLS connection logs for certificates that bypass normal chain validation patterns
How to Mitigate CVE-2026-34580
Immediate Actions Required
- Upgrade Botan to version 3.11.1 or later immediately
- Audit any applications using Botan 3.11.0 for certificate validation functionality
- Review recent connections for potential exploitation attempts
- Consider implementing additional certificate pinning as defense in depth
Patch Information
The vulnerability is fixed in Botan version 3.11.1. Organizations should update their Botan installations immediately. For detailed patch information and release notes, refer to the GitHub Security Advisory.
Workarounds
- If immediate upgrade is not possible, implement additional certificate validation checks independent of certificate_known
- Consider certificate pinning for critical connections to ensure only expected certificates are accepted
- Temporarily disable or bypass the affected path validation extension if application architecture permits
- Implement application-level certificate fingerprint verification before accepting certificates
# Upgrade Botan to patched version
# For package manager installations, update to 3.11.1 or later
# Example for building from source:
git clone https://github.com/randombit/botan.git
cd botan
git checkout 3.11.1
./configure.py
make
make install
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

