Botan: Integer overflow in FFI block size reporting can cause memory corruption
Summary
The Botan cryptography library reports the block size of a block cipher through its C API without checking for overflow when converting to int. An application that accepts external algorithm parameter strings and uses the FFI raw ECB mode can be tricked by an attacker into selecting the variable-block-size Lion cipher, leading to truncated size reporting, insufficient buffer allocation and memory corruption. The C++ API and commonly used C API modes such as CBC and CTR are not affected.
Affected
- Botan versions from 2.1.0 up to but not including 3.13.0
- Only applications using the C FFI raw ECB mode with user-selectable algorithms (Lion)
- Note: VulDB lists the range as up to 3.12.x; the CNA range is used here
Fixed in
- Botan 3.13.0 (fix in PR #5805 and commit c6089ab)
Workaround
- No vendor workaround documented; upgrading to 3.13.0 is the fix
- Interim (not vendor guidance): do not let untrusted users choose cipher names, use an algorithm allowlist, avoid raw ECB via the C FFI with user-supplied parameters
Exploitation
- No public proof of concept found
- No known exploitation in the wild; CISA SSVC: exploitation none, automatable no, technical impact total
- EPSS: 0.37 % (30th percentile)
Our recommendation
- Inventory systems and software that bundle Botan and check for versions below 3.13.0
- Update Botan to 3.13.0 or the patched package from your distribution or software vendor
- Ask in-house developers and software vendors whether they use raw ECB via the C FFI with user-selectable algorithms; if so, prioritise the patch
- Otherwise treat as routine patching
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-c68p-822g-jfvr github.com
- Botan fix pull request #5805 github.com
- Botan fix commit c6089ab github.com
- NixOS tracker: botan3 backport github.com
- Botan news (3.13.0 release) botan.randombit.net
- VulDB entry 428699 vuldb.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 03:54.
Original description (NVD)
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.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
