---
id: "CVE-2026-118767"
kind: "vulnerability"
aliases: ["CVE-2026-118767"]
title: "Botan Python binding: bcrypt truncates passwords at embedded NUL bytes"
severity: "medium"
cvss: 4.8
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["botan", "package", "password-hashing", "python"]
not_affected_if: ["non-python-binding", "nul-characters-rejected", "scrypt-or-argon2-only"]
published_at: "2026-10-29T18:17:28+00:00"
first_seen_at: "2026-10-29T18:26:33+00:00"
updated_at: "2026-10-29T18:28:46+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118767", "first_seen_at": "2026-10-29T18:26:33+00:00"}]
---

# Botan Python binding: bcrypt truncates passwords at embedded NUL bytes

Botan's Python binding passes strings containing a NUL character to bcrypt and check_bcrypt, which hash only the part before the NUL. An application that validates a long password but hashes the truncated value can have its password policy bypassed.

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

## How to check

- Check the installed Botan version with `python -c "import botan3; print(botan3.version_string())"` or the package manager, and compare against the fixed release.
- Search the codebase for calls to `bcrypt` or `check_bcrypt` from the Botan Python binding that receive user-supplied passwords.

## Fix

- Botan `3.13.0` (fixed version per the description; affected range from `1.11.22` until `3.13.0`)

## Timeline

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

## From the sources

Botan is a C++ cryptography library. From 1.11.22 until 3.13.0, Botan's Python binding converted Python strings containing U+0000 to const char* values without consistently rejecting the embedded NUL, causing bcrypt and check_bcrypt to process only the prefix before the NUL. Applications could validate a longer password but hash a shorter effective value, allowing application password-policy bypass; scrypt and argon2 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_
