CVE-2026-118767: Botan Python binding password hashing bypass

CVE-2026-118767 · Severity: medium · CVSS 4.8 · Published 2026-10-29

Botan is a widely-used cryptography library with Python bindings. In versions 1.11.22 through 3.12.x, password hashing functions (bcrypt and check_bcrypt) would silently truncate passwords at the first NUL character, allowing attackers to bypass password validation by embedding NUL bytes. An application might validate a password "admin\x00secret", but the hashing function would only process "admin", enabling unauthorized access.

Technologies: Botan. Vendors: Botan.

Quick answers

Is CVE-2026-118767 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-118767 being exploited in the wild.
How severe is CVE-2026-118767?
Medium severity, with a CVSS score of 4.8, published 29 October 2026.
Which products and versions are affected?
Botan 1.11.22 through 3.12.x.
Is there a fix for CVE-2026-118767?
Yes: fixed in 3.13.0. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-118767 attacked?
It is attacked over the network.
Am I affected by CVE-2026-118767?
Check whether you run Botan at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: 3.13.0

Technical details

The Python binding's _ctype_str() function converted Python strings to C char* without rejecting embedded NUL bytes; bcrypt and check_bcrypt would then process only the string prefix before the NUL, creating a discrepancy between what Python code validated and what was hashed. An attacker with knowledge of the truncated password could log in using the full string containing NULs. The fix adds validation in _ctype_str() to raise ValueError for any embedded NUL bytes.

Affected products

  • Botan Botan 1.11.22 through 3.12.x

Timeline

  • 2026-10-29: disclosed
  • 2026-08-07: patched: Fix merged to master branch

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.