---
id: "CVE-2026-118769"
kind: "vulnerability"
aliases: ["CVE-2026-118769"]
title: "Botan C++ cryptography library: block size truncation enables memory corruption"
severity: "critical"
cvss: 9.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["botan", "c++", "c-api", "cryptography", "package"]
not_affected_if: ["c++-api-only", "cbc-or-ctr-modes", "no-external-cipher-selection"]
published_at: "2026-10-29T18:17:29+00:00"
first_seen_at: "2026-10-29T18:26:33+00:00"
updated_at: "2026-10-29T18:28:42+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118769", "first_seen_at": "2026-10-29T18:26:33+00:00"}]
---

# Botan C++ cryptography library: block size truncation enables memory corruption

Botan's C API function botan_block_cipher_block_size converts a size_t to int without a bounds check, so a large Lion cipher block size is truncated. An attacker who can pick the cipher through external parameter strings in an app using raw ECB mode can cause the caller to under-allocate and corrupt memory.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the Botan version in use, for example with `botan version` or the package manager lockfile.
- Search your code for calls to the Botan C API (`botan_block_cipher_*`) using raw ECB mode.
- Check whether cipher names from user or external input are passed straight to Botan.

## Fix

- Upgrade Botan to `3.13.0`.

## Timeline

- 2026-10-29T18:26:33+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-118769

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
