Security Resilience

CVE-2025-40906

Memory Safety in MONGODB BSON::XS

Published
16 May 2025
Modified
17 June 2026
CVSS Score v3.1 9.8
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0065 52th percentile
Risk Priority 72 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2025-40906 is a critical-severity Heap-based Buffer Overflow (CWE-122) vulnerability in MONGODB BSON::XS (named in the CVE record; NVD lists no product yet). Its CVSS base score is 9.8 (Critical).

Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked in the top 48% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SA-22 (Unsupported System Components) — see the control section below for these in your framework.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

BSON::XS versions 0.8.4 and earlier for Perl includes a bundled libbson 1.1.7, which has several vulnerabilities. Those include CVE-2017-14227, CVE-2018-16790, CVE-2023-0437, CVE-2024-6381, CVE-2024-6383, and CVE-2025-0755. BSON-XS was the official Perl XS implementation of MongoDB's BSON serialization, but this distribution has…

more

reached its end of life as of August 13, 2020 and is no longer supported.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1203 Exploitation for Client Execution Execution
Adversaries may exploit software vulnerabilities in client applications to execute code.
T1210 Exploitation of Remote Services Lateral Movement
Adversaries may exploit remote services to gain unauthorized access to internal systems once inside of a network.
T1499 Endpoint Denial of Service Impact
Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade or block the availability of services to users.
T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-69594Shared CWE-122, CWE-190
CVE-2026-83828Shared CWE-122, CWE-190
CVE-2026-55191Shared CWE-122, CWE-190
CVE-2025-40907Shared CWE-122, CWE-190
CVE-2024-22211Shared CWE-122, CWE-190
CVE-2026-70149Shared CWE-122, CWE-190
CVE-2026-55033Shared CWE-122, CWE-190
CVE-2026-123377Shared CWE-122, CWE-190
CVE-2026-48690Shared CWE-122, CWE-190
CVE-2026-119858Shared CWE-122, CWE-190

Affected Assets

MONGODB
BSON::XS
named in the CVE record; NVD lists no product yet

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

—

Detect
Catch it (NIST detect / respond)

—

Harden
Shrink the surface (DISA STIG)
  • 1 hardening rule · 1 OS baseline
Validate
Prove the fix (OWASP ASVS)
  • V15.1.2
  • V1.4.1
  • V5.2.6

Mitigating Controls (NIST 800-53 r5)

Our mappings, made for this CVE.

SA-22 directly requires replacing components once vendor support ends, structurally preventing reliance on unmaintained third-party code.

Developer testing and evaluation (including fuzzing and memory-error detectors) can discover heap overflows after they have been coded.

Input validation enforces bounds checking on data written to heap buffers, directly stopping the overflow condition from being introduced.

Security engineering principles require use of memory-safe constructs and bounds-checked allocation routines that avoid introducing heap overflows.

Memory-protection mechanisms limit the ability of a heap overflow to execute attacker-controlled code or corrupt adjacent structures.

Mitigating Controls (NIST CSF 2.0)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 full match
blocks

Secure-development practices directly require bounds checking and safe memory handling that prevent heap overflows.

GV.RM-04 partial match
blocks

GV.RM-04's high-level risk-response criteria can indirectly discourage unmaintained third-party use via policy, but alone removes none of the concrete supply-chain or maintenance decisions that produce CWE-1104.

ID.RA-01 partial match
blocks

Vulnerability scanning and recording can discover heap-overflow flaws but does not prevent their introduction in code.

PR.PS-02 partial match
blocks

Timely patching removes known heap-overflow instances after they exist.

Mitigating Controls (ISO/IEC 27001:2022 Annex A)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

A.5.21's supply chain programme requires suppliers to disclose component information (item d), tracks component lifecycle and end-of-availability risks (item m), and identifies critical components requiring scrutiny (item g) — a well-implemented programme builds a component inventory with maintenance status that surfaces most unmaintained third-party components, with a bounded remainder (sub-components the prime supplier does not track, status changes the supplier fails to notify).

finds

Security testing in development and acceptance can detect heap overflows before release.

prevents

A.5.19's supplier evaluation and selection processes (b, c, e, f) can require maintenance status as a criterion, keeping some unmaintained components out at procurement; but the clause governs the supplier relationship framework, not the technical decision to use a specific component, so an organization under it can still acquire unmaintained components within an otherwise-approved supplier's offerings or through channels the relationship processes don't reach.

finds

A.5.22's monitoring of supplier relationships can surface unmaintained components through supplier disclosures (end-of-life announcements, change notifications under items b/c), audits (item e), and review of supplier reports (item d), but its reach is disclosure-based and bounded by what the supplier relationship surfaces — it has no source-level or runtime reach into the supplier's components, so unmaintained components that are not formally announced or caught in audit remain invisible, leaving a large unnamed remainder.

blocks

A.8.20 secures the network perimeter and traffic, but an unmaintained third-party component is a software supply chain defect that is exploitable regardless of network controls once the component is installed and reachable.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over our cross-walk; rows rated `none` are excluded, and each rule says how its mapping was checked.

Definition changed on 29 October 2026. Until then this section listed every rule rated above none, partial included. From that date it lists rules whose mapping is rated full or mostly and checked at llm_unverified or higher; partial mappings show when you ask.

No rule maps to these weaknesses at full or mostly. Tick the option above to see the partial mappings.

Oracle Linux 8 (1 partial rule)
  • V-248521 OL 8 must be a vendor-supported release. blocks CWE-1104

References