The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-40906

CVE-2025-40906: BSON::XS for Perl Bundled Library Vulnerability

CVE-2025-40906 affects BSON::XS versions 0.8.4 and earlier for Perl, which bundles vulnerable libbson 1.1.7. This article covers the security risks, affected versions, and recommended mitigation strategies.

Published: March 24, 2026

CVE-2025-40906 Overview

CVE-2025-40906 is a critical heap buffer overflow vulnerability affecting BSON::XS versions 0.8.4 and earlier for Perl. The vulnerability stems from the inclusion of a bundled libbson version 1.1.7, which contains multiple known security vulnerabilities including 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. This distribution has reached its end of life as of August 13, 2020 and is no longer supported, making this vulnerability particularly concerning for legacy systems that may still rely on this deprecated component.

Critical Impact

Network-accessible heap buffer overflow in end-of-life MongoDB Perl BSON serialization library allows remote attackers to achieve code execution, data compromise, or denial of service without authentication.

Affected Products

  • BSON::XS versions 0.8.4 and earlier for Perl
  • Systems using bundled libbson 1.1.7
  • Legacy MongoDB Perl driver implementations

Discovery Timeline

  • May 16, 2025 - CVE-2025-40906 published to NVD
  • September 5, 2025 - Last updated in NVD database

Technical Details for CVE-2025-40906

Vulnerability Analysis

This vulnerability is classified as CWE-122 (Heap-based Buffer Overflow). The root issue lies in the bundled libbson 1.1.7 library included with BSON::XS, which has accumulated multiple security vulnerabilities over the years since the distribution reached end-of-life status. Heap buffer overflow vulnerabilities occur when data is written beyond the allocated heap memory boundaries, potentially allowing attackers to corrupt adjacent memory, hijack control flow, or execute arbitrary code.

The vulnerability is network-accessible and requires no user interaction or privileges to exploit, making it particularly dangerous for any systems still running the deprecated BSON::XS library in network-exposed configurations. Since BSON serialization is commonly used in MongoDB database communications, vulnerable systems processing untrusted BSON data from network sources are at significant risk.

Root Cause

The vulnerability originates from the inclusion of an outdated and unmaintained bundled libbson library (version 1.1.7) within the BSON::XS Perl distribution. This bundled dependency approach meant that even after upstream libbson received security patches, BSON::XS installations continued to ship vulnerable code. With the distribution reaching end-of-life in August 2020, no updates were released to address the accumulated security issues in the bundled library.

The heap buffer overflow specifically occurs during BSON data parsing operations where input validation is insufficient, allowing maliciously crafted BSON documents to trigger memory corruption conditions.

Attack Vector

The attack vector is network-based and can be exploited remotely without authentication. An attacker can exploit this vulnerability by sending specially crafted BSON-serialized data to a vulnerable application. When the BSON::XS library attempts to deserialize the malicious input, the heap buffer overflow is triggered.

Attack scenarios include targeting applications that accept BSON data from untrusted network sources, MongoDB client applications processing malicious server responses, or any Perl application using BSON::XS to process external data. The exploitation does not require any privileges or user interaction, making automated attacks feasible.

Detection Methods for CVE-2025-40906

Indicators of Compromise

  • Unexpected crashes or segmentation faults in Perl applications using BSON::XS during data processing
  • Anomalous memory consumption patterns in processes handling BSON serialization
  • Application logs indicating BSON parsing errors or memory corruption events
  • Suspicious network traffic containing malformed or oversized BSON payloads

Detection Strategies

  • Audit systems for installations of BSON::XS Perl module versions 0.8.4 or earlier using cpan -l | grep BSON::XS or checking perl -MBSON::XS -e 'print $BSON::XS::VERSION'
  • Monitor for applications importing or requiring the deprecated BSON::XS module in production environments
  • Implement network intrusion detection rules to identify malformed BSON traffic targeting MongoDB ports
  • Utilize SentinelOne's Singularity platform to detect exploitation attempts through behavioral analysis of memory access patterns

Monitoring Recommendations

  • Enable heap corruption detection mechanisms in Perl runtime environments where BSON::XS may be present
  • Configure application-level logging to capture BSON deserialization errors and exceptions
  • Deploy runtime application self-protection (RASP) solutions to monitor for buffer overflow exploitation attempts
  • Leverage SentinelOne's autonomous endpoint protection to identify and block exploit attempts in real-time

How to Mitigate CVE-2025-40906

Immediate Actions Required

  • Inventory all systems and applications using the deprecated BSON::XS Perl module
  • Migrate to actively maintained alternatives such as the pure-Perl BSON module or other supported MongoDB Perl drivers
  • Isolate systems that cannot be immediately migrated from untrusted network traffic
  • Apply any available operating system-level security patches as indicated in the Debian LTS Announcement

Patch Information

BSON::XS has reached end-of-life status as of August 13, 2020 and will not receive security updates from the original maintainers. Organizations must migrate to supported alternatives. Debian LTS has issued guidance for affected systems as documented in their security announcement. The MongoDB Community Forum provides additional information on the MongoDB Perl driver deprecation and recommended migration paths.

For Debian-based systems, consult the Debian LTS announcement for available package updates that may address the bundled libbson vulnerabilities at the distribution level.

Workarounds

  • Remove BSON::XS from production systems and replace with the actively maintained pure-Perl BSON module from CPAN
  • Implement strict input validation and sanitization for any BSON data before it reaches vulnerable parsing code
  • Deploy network-level controls to filter potentially malicious BSON payloads at ingress points
  • Run applications using BSON::XS in sandboxed environments with restricted privileges to limit exploitation impact
bash
# Remove deprecated BSON::XS and install pure-Perl alternative
cpan -U BSON::XS
cpan install BSON

# Verify BSON::XS is no longer installed
perl -MBSON::XS -e 'print $BSON::XS::VERSION' 2>/dev/null && echo "WARNING: BSON::XS still installed" || echo "BSON::XS successfully removed"

# Update application code to use BSON instead of BSON::XS
# Replace: use BSON::XS;
# With: use BSON;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeOther

  • Vendor/TechBson

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.60%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-122
  • Technical References
  • Debian LTS Announcement

  • MongoDB Community Forum Discussion
  • Latest CVEs
  • CVE-2025-9185: Mozilla Firefox RCE Vulnerability

  • CVE-2025-9184: Mozilla Firefox RCE Vulnerability

  • CVE-2025-9180: Mozilla Firefox Auth Bypass Vulnerability

  • CVE-2025-8030: Mozilla Firefox RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English