Skip to main content

Botan CVE-2026-104267

| EUVDEUVD-2026-118516 MEDIUM
Out-of-bounds Write (CWE-787)
2026-11-06 GitHub_M
4.1
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft PKCS#8 key with overflowing Scrypt params
  2. Exploit
    Deliver to 32-bit app decrypting untrusted keys
  3. Execution
    Unchecked multiplication wraps heap allocation size
  4. Impact
    ~4GB out-of-bounds write crashes process (DoS)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Three concrete prerequisites must all hold: (1) the target is compiled/running on a 32-bit platform - 64-bit builds are unaffected because size_t does not wrap; (2) the Botan 'scrypt' module is enabled in the build; and (3) the application feeds attacker-controlled Scrypt parameters (N, r, p) into Scrypt, the notable documented vector being decryption of an attacker-supplied PKCS#8 encrypted private key using PBE-PKCS5v20 with the Scrypt KDF. The triggering condition is parameter sets where (N+1)*128*r exceeds 0xFFFFFFFF. Limiting factors: the entire 64-bit deployment base is immune, Scrypt must be reachable with untrusted parameters, and the application or user must initiate processing of the hostile key; impact is confined to a crash with no confirmed confidentiality or integrity loss.

Impact

This is a medium-severity, DoS-dominant issue rather than a top-priority emergency. The supplied CVSS 4.0 vector scores 4.1 and sets VA:H with VC:N/VI:N, matching the description: the confirmed impact is a process crash (denial of service), not data compromise. Exploitation is gated by a deployment precondition reflected as AT:P - the overflow occurs only on 32-bit platforms (where size_t is 32-bit), and only in applications that enable Scrypt and accept attacker-controlled Scrypt parameters. No EPSS score was provided, so exploitation probability cannot be quantified. The issue is not in CISA KEV, and no working exploit code is in the inputs (the advisory ships only a detection helper, is_scrypt_pkcs8_large_params, not an exploit). The 'RCE' input tag overstates the risk: the description explicitly states arbitrary code execution is not demonstrated and appears difficult, though it cannot be fully excluded from the out-of-bounds write primitive. The vuln.today decision label is 'this_month', consistent with a bounded-impact, condition-limited bug. One signal to verify: the provided 4.0 vector sets PR:L (implying some privilege), yet the documented path - submitting a malicious encrypted private key - does not obviously require attacker privileges, so the privilege metric is worth confirming with the vendor.

Exploit ScenarioDerived

An attacker crafts a PKCS#8 encrypted private key whose Scrypt KDF parameters (N, r) are chosen so that 128*r*(N+1) exceeds 2^32, then delivers it to a 32-bit application that decrypts untrusted private keys. When the app parses and processes the key, the unchecked multiplication wraps the allocation size, producing a heap buffer far smaller than needed, and roughly four gigabytes of Scrypt output is written past it, crashing the process. No public working exploit was identified at time of analysis; the vendor advisory publishes only a parameter-detection function, not exploit code.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 06, 2026

Botan's Scrypt implementation on 32-bit builds can wrap an allocation-size calculation, under-allocate a heap buffer, and then write roughly four gigabytes of Scrypt output past the allocation, crashing the process. The flaw affects Botan 2.7.0 through 3.12.0 when the scrypt module is enabled and the application passes attacker-controlled Scrypt parameters, most notably while decrypting attacker-supplied PKCS#8 encrypted private keys; 64-bit builds are unaffected. Impact is denial of service (the assessed risk is medium-severity and DoS-dominant rather than a top-priority emergency), arbitrary code execution is not demonstrated and appears difficult although it cannot be excluded from the overwrite primitive, and the issue is fixed in Botan 3.13.0; no public exploit has been identified at time of analysis.

RemediationAI

Vendor-released patch: upgrade to Botan 3.13.0. The advisory is at https://github.com/randombit/botan/security/advisories/GHSA-36rp-hhp4-wh83 and the fix is in PR https://github.com/randombit/botan/pull/5629 and commit https://github.com/randombit/botan/commit/459acdeba242dacc11ad8225e7d3e28203ce4f78. If upgrading is not immediately possible, the vendor lists two workarounds: disable the scrypt module in the build, which removes Scrypt KDF support and may break password-based encryption or decryption that relies on Scrypt, or use the provided is_scrypt_pkcs8_large_params check to inspect untrusted PKCS#8 private keys before deserialization and reject keys whose computed V_bytes exceeds 0xFFFFFFFF, which is an application-level pre-check that must be applied wherever hostile keys are parsed and only covers that documented vector. 64-bit builds are not affected by this defect.

Affected VersionsENISA

Botan 2.7.0, < 3.13.0

Affected Packages

euvd botan fix: 3.13.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Botan is a C++ cryptography library that implements password-based key derivation, including Scrypt. The vulnerable code computes Scrypt memory usage as 128 * r * (N + p) using unchecked size_t multiplication; on 32-bit platforms, attacker-controlled N, r and p can make that product wrap so the allocated buffer is smaller than the algorithm later writes to, a CWE-787 out-of-bounds write. The triggering condition is parameter sets where (N+1)*128*r exceeds 0xFFFFFFFF, after which about 4 GB of Scrypt output is written past the heap buffer and the process crashes. Only 32-bit builds with the scrypt module enabled and reachable with hostile parameters are affected, with the documented vector being decryption of an attacker-supplied PKCS#8 encrypted private key using PBE-PKCS5v20 with the Scrypt KDF; 64-bit builds are immune because size_t does not wrap. The assessed vector is network-reachable with no privileges required and user interaction, but all three deployment prerequisites above must hold. The 3.13.0 fix replaces the unchecked arithmetic with checked_mul/checked_add, caps Scrypt N at 4194304 and memory at 2 GB on 32-bit (8 GB on 64-bit), and rejects parameters that exceed the platform limit.

Know when Botan gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 4.1 MEDIUM
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 5.3 MEDIUM

AV:N and PR:N since a hostile key is submitted as data with no attacker privileges; AC:H because the target must be a 32-bit build with Scrypt enabled; only A:H (crash).

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Nov 06, 2026 - 22:03 EUVD

DescriptionCVE.org

Botan is a C++ cryptography library. From 2.7.0 until 3.13.0, Botan's Scrypt implementation on 32-bit platforms computes required memory with unchecked multiplication, allowing attacker-controlled Scrypt parameters to wrap the allocation size and create a buffer smaller than the algorithm subsequently writes. The issue affects systems that enable Scrypt and accept arbitrary parameters from a hostile source, including applications that decrypt attacker-supplied encrypted private keys. A triggering parameter set can cause approximately four gigabytes of Scrypt output to be written past the allocated heap buffer, immediately crashing the process and causing denial of service. Arbitrary code execution is not demonstrated and appears difficult, but cannot be excluded from the overwrite primitive. This issue is fixed in version 3.13.0.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Prevalence
Low
niche general-purpose C++ crypto library, modest footprint versus OpenSSL
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

20
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +20
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Botan

View all
CVE-2016-2195 CRITICAL
9.8 May 13

Integer overflow in the PointGFp constructor in Botan before 1.10.11 and 1.11.x before 1.11.27 allows remote attackers t

CVE-2016-2196 CRITICAL
9.8 May 13

Heap-based buffer overflow in the P-521 reduction function in Botan 1.11.x before 1.11.27 allows remote attackers to cau

CVE-2017-2801 MEDIUM POC
6.5 May 24

A programming error exists in a way Randombit Botan cryptographic library version 2.0.1 implements x500 string compariso

CVE-2024-50383 MEDIUM POC
5.9 Oct 23

Botan before 3.6.0, when certain GCC versions are used, has a compiler-induced secret-dependent operation in lib/utils/d

CVE-2024-50382 MEDIUM POC
5.9 Oct 23

Botan before 3.6.0, when certain LLVM versions are used, has compiler-induced secret-dependent control flow in lib/utils

CVE-2021-40529 MEDIUM POC
5.9 Sep 06

The ElGamal implementation in Botan through 2.18.1, as used in Thunderbird and other products, allows plaintext recovery

CVE-2018-12435 MEDIUM POC
5.9 Jun 15

Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of

CVE-2015-7826 CRITICAL
9.8 Apr 10

botan 1.11.x before 1.11.22 improperly handles wildcard matching against hostnames, which might allow remote attackers t

CVE-2016-6878 CRITICAL
9.8 Apr 10

The Curve25519 code in botan before 1.11.31, on systems without a native 128-bit integer type, might allow attackers to

CVE-2016-9132 CRITICAL
9.8 Jan 30

In Botan 1.8.0 through 1.11.33, when decoding BER data an integer overflow could occur, which would cause an incorrect l

CVE-2021-24115 CRITICAL
9.8 Feb 22

In Botan before 2.17.3, constant-time computations are not used for certain decoding and encoding operations (base32, ba

CVE-2018-9127 CRITICAL
9.8 Apr 02

Botan 2.2.0 - 2.4.0 (fixed in 2.5.0) improperly handled wildcard certificates and could accept certain certificates as v

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy