Description
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.
Published: 2026-10-29
Score: 4.8 Medium
EPSS: n/a
KEV: No
Impact: Password‑policy bypass
Action: Apply patch
AI Analysis

Impact

When a Python string contains an embedded NUL (U+0000), the Botan Python binding converts it to a const char* without consistently rejecting the NUL. As a result, the bcrypt and check_bcrypt functions truncate the password at the first NUL, hashing only the preceding prefix. Applications that validate a longer password against policy checks may therefore store and compare a shorter hashed value, enabling a user to satisfy the policy with a weak password that is effectively hidden in the stored hash. This flaw is a data conversion misuse, identified as CWE‑158. Cryptographic algorithms scrypt and argon2 are unaffected.

Affected Systems

Randombit Botan is affected. Any installation of Botan from version 1.11.22 up through 3.13.0 (inclusive) includes a Python binding that improperly handles NUL bytes in passwords. The issue is fixed in version 3.13.0.

Risk and Exploitability

The CVSS score is 4.8, indicating moderate severity. No EPSS score is available and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector is local or application‑level, requiring the attacker to supply a crafted password to the binding. If the application relies on bcrypt for authentication, the truncation can allow a password that meets policy requirements to be hashed incorrectly, effectively bypassing the password policy. Because the flaw does not directly lead to code execution or system compromise, the overall risk is limited to authentication and policy enforcement, but the impact on the integrity of password validation is significant.

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

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Botan to version 3.13.0 or newer, which removes the truncation flaw
  • Modify application logic to reject or sanitize passwords that contain NUL characters before passing them to the bcrypt API
  • Validate that the resulting bcrypt hash corresponds to the entire intended password string as a compliance check
  • Run regression tests to confirm that password policy enforcement now behaves correctly after the upgrade or sanitization

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 29 Oct 2026 19:45:00 +0000

Type Values Removed Values Added
First Time appeared Randombit
Randombit botan
Vendors & Products Randombit
Randombit botan

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

Type Values Removed Values Added
Description 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.
Title Botan: Python binding bcrypt APIs truncate passwords containing embedded NULs
Weaknesses CWE-158
References
Metrics cvssV3_1

{'score': 4.8, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-29T17:17:24.323Z

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

Link: CVE-2026-118767

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

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

Link: CVE-2026-118767

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-29T19:30:15Z

Weaknesses
  • CWE-158

    Improper Neutralization of Null Byte or NUL Character