Cloudanix VulnDB

CVE-2024-34702

Medium · 5.3

CVSS

5.3

EPSS

0.8%

Published

Jul 8, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A cryptography library used by many programs can be slowed to a crawl when it checks certain kinds of digital certificates, potentially disrupting services until the library is updated.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Denial of service
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

X.509 name constraint validation in the Botan library performs quadratic work relative to the number of SubjectAlternativeName entries and name constraints, allowing remote CPU exhaustion via a crafted certificate chain.

Why it matters to the business

Applications that accept untrusted certificate chains may experience denial of service and resource exhaustion; the issue has been public for over two years with low exploitability and no observed in-the-wild use.

How an attack unfolds

An attacker crafts a certificate chain containing a large number of names in the SubjectAlternativeName extension, signed by a CA certificate that also contains many name constraints, and presents it during TLS or certificate validation; the quadratic algorithm causes excessive CPU consumption leading to service degradation or outage.

How to fix it

Upgrade to Botan 3.5.0 or later, or apply the partial backport present in 2.19.5. For the GIT repository, update to commit 935055e839794a076d209c9e9a1e9cd2255aae01 or newer. Rebuild and redeploy all dependent applications after the library update.

How to confirm the fix worked

Confirm the installed Botan version is 3.5.0+, 2.19.5+, or contains commit 935055e. Exercise certificate validation paths with large name-constraint test vectors and verify that processing time remains linear.

Typical attack path

  1. Identify a target service that uses Botan for X.509 certificate validation and accepts client or server certificates.
  2. Generate or obtain a CA certificate containing a large number of name constraints.
  3. Create an end-entity certificate with a very large number of SubjectAlternativeName entries.
  4. Present the malicious certificate chain during the TLS handshake or certificate processing path.
  5. Observe resource exhaustion on the target as the quadratic validation routine consumes CPU.

How to detect it

Look in application and system logs for unusually long certificate validation times or spikes in CPU usage coinciding with incoming TLS connections; correlate with services that embed Botan for certificate handling.

What your security team should do

  • Prioritize upgrade of Botan to a fixed version in all products that perform X.509 validation.
  • Review dependency manifests and rebuild pipelines to ensure the patched library is used.
  • Monitor CPU and memory usage on services that process external certificates while the upgrade is pending.
  • Add automated dependency scanning to detect future vulnerable versions of Botan.

The record

Botan is a C++ cryptography library. X.509 certificates can identify elliptic curves using either an object identifier or using explicit encoding of the parameters. Prior to 3.5.0 and 2.19.5, checking name constraints in X.509 certificates is quadratic in the number of names and name constraints. An attacker who presented a certificate chain which contained a very large number of names in the SubjectAlternativeName, signed by a CA certificate which contained a large number of name constraints, could cause a denial of service. The problem has been addressed in Botan 3.5.0 and a partial backport has also been applied and is included in Botan 2.19.5.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.17 botan 0 2.19.5-r0
Alpine:v3.18 botan 0 2.19.5-r0
Alpine:v3.19 botan 0 2.19.5-r0
Alpine:v3.20 botan 0 2.19.5-r0
Alpine:v3.21 botan 0 2.19.5-r0
Alpine:v3.21 botan3 0 3.5.0-r0
Alpine:v3.22 botan3 0 3.5.0-r0
Debian:11 botan 0 No fix
Debian:12 botan 0 No fix
Debian:13 botan 0 2.19.5+dfsg-1
Debian:14 botan 0 2.19.5+dfsg-1
SUSE:Package Hub 15 SP5 Botan 0 2.19.5-bp155.2.3.1
Ubuntu:18.04:LTS botan 0 No fix
Ubuntu:20.04:LTS botan 0 No fix
Ubuntu:22.04:LTS botan 0 No fix
Ubuntu:24.04:LTS botan 0 No fix
Ubuntu:24.10 botan 0 No fix
Ubuntu:Pro:18.04:LTS botan 0 No fix
Ubuntu:Pro:20.04:LTS botan 0 No fix
Ubuntu:Pro:22.04:LTS botan 0 2.19.1+dfsg-2ubuntu1+esm1
Ubuntu:Pro:24.04:LTS botan 0 2.19.3+dfsg-1ubuntu2+esm1
openSUSE:Leap 15.5 Botan 0 2.19.5-bp155.2.3.1
openSUSE:Tumbleweed Botan 0 2.19.5-1.1

Related vulnerabilities