CVE-2026-118769

Botan: Integer overflow when reporting block size in FFI can cause memory corruption

Published Oct 29, 2026 CVSS 4.0 · 9.2 Critical EPSS < 1% KEV · Not listed
Description
Botan is a C++ cryptography library. From 2.1.0 until 3.13.0, the Botan C API function botan_block_cipher_block_size converted a size_t block size to int without a bounds check. In an application that accepts external algorithm parameter strings and uses the FFI raw ECB mode, an attacker can select the variable-block-size Lion cipher so that the reported size is truncated, the caller allocates insufficient memory, and later block processing causes memory corruption. The C++ API and normally used C API modes such as CBC and CTR are unaffected. This issue is fixed in version 3.13.0.

Analysis

AI-generated

Technical impact

The vulnerability arises from an integer overflow in the Botan function botan_block_cipher_block_size, which converts a size_t block size to an int without bounds checking. When an attacker supplies an external algorithm name that selects the variable-block-size Lion cipher, the reported block size is truncated. The application then allocates less memory than required; subsequent block processing corrupts memory. This flaw can lead to arbitrary code execution or data compromise, but only affects the FFI raw ECB mode. The C++ API and other common C API modes such as CBC and CTR remain unaffected.

Affected Systems

The affected library is botan from the vendor randombit. Versions from 2.1.0 through 3.13.0 are vulnerable. The issue is fixed in version 3.13.0. Users should verify which version they run and whether the application uses the FFI raw ECB mode with externally supplied algorithm strings.

Risk and Exploitability

With a CVSS score of 9.2 this issue is high severity. The EPSS score is not available, indicating that the current exploitation probability is undetermined, yet the memory corruption offers a serious risk. The vulnerability is not listed in the CISA KEV catalog. The likely attack vector is by delivering a crafted algorithm name string to an application that exposes botan via the FFI raw ECB interface, allowing an attacker to control the reported block size and trigger the overflow. While the condition requires application-specific use of the vulnerable API, the consequences are severe if met.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Botan library to version 3.13.0 or newer where the integer overflow is fixed.
  • If an immediate upgrade is not feasible, disable or remove usage of the FFI raw ECB mode and prevent external inputs from determining the block size used by botan_block_cipher_block_size.
  • Add application-side validation to ensure that any block size value returned from botan_block_cipher_block_size is within the expected range before allocating memory for encryption operations.

Generated by OpenCVE AI on October 29, 2026 at 18:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Randombit
Randombit botan
Vendors & Products Randombit
Randombit botan
Type Values Removed Values Added
Description Botan is a C++ cryptography library. From 2.1.0 until 3.13.0, the Botan C API function botan_block_cipher_block_size converted a size_t block size to int without a bounds check. In an application that accepts external algorithm parameter strings and uses the FFI raw ECB mode, an attacker can select the variable-block-size Lion cipher so that the reported size is truncated, the caller allocates insufficient memory, and later block processing causes memory corruption. The C++ API and normally used C API modes such as CBC and CTR are unaffected. This issue is fixed in version 3.13.0.
Title Botan: Integer overflow when reporting block size in FFI can cause memory corruption
Weaknesses CWE-125
CWE-681
CWE-787
References
Metrics cvssV4_0

{'score': 9.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-125

    Out-of-bounds Read

  • CWE-681

    Incorrect Conversion between Numeric Types

  • CWE-787

    Out-of-bounds Write

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 29, 2026, 8:21 PM
Reserved
Oct 28, 2026, 7:20 PM
Status
Awaiting Analysis
Published
Oct 29, 2026, 6:17 PM
Modified
Oct 30, 2026, 7:37 PM
Severity
Moderate
Public date
Oct 29, 2026, 5:22 PM