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.
Published: 2026-10-29
Score: 9.2 Critical
EPSS: n/a
KEV: No
Impact: Memory corruption leading to potential arbitrary code execution
Action: Immediate Patch
AI Analysis

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.

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

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 yet.

History

Thu, 29 Oct 2026 17:30:00 +0000

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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-29T17:22:07.316Z

Reserved: 2026-10-28T19:20:05.017Z

Link: CVE-2026-118769

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-29T18:17:29.180

Modified: 2026-10-29T18:17:29.180

Link: CVE-2026-118769

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-29T18:30:14Z

Weaknesses
  • CWE-125

    Out-of-bounds Read

  • CWE-681

    Incorrect Conversion between Numeric Types

  • CWE-787

    Out-of-bounds Write