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
    • 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-2026-2739

CVE-2026-2739: bn.js Denial of Service (DOS) Vulnerability

CVE-2026-2739 is a denial of service flaw in bn.js versions before 5.2.3. The maskn(0) method corrupts internal state, causing infinite loops that hang processes. This article covers technical details, affected versions, and mitigation.

Published: February 27, 2026

CVE-2026-2739 Overview

CVE-2026-2739 is a Denial of Service vulnerability affecting the bn.js JavaScript library, a widely-used arbitrary-precision integer arithmetic package for Node.js and browser environments. The vulnerability exists in versions prior to 5.2.3 and occurs when calling maskn(0) on any BN instance. This operation corrupts the internal state of the BN object, causing subsequent method calls including toString(), divmod(), and other operations to enter an infinite loop, hanging the process indefinitely.

Critical Impact

Applications using vulnerable versions of bn.js can be completely locked up through a simple API call, causing service disruption for any system relying on big number arithmetic operations.

Affected Products

  • bn.js versions prior to 5.2.3
  • Applications and libraries dependent on vulnerable bn.js versions
  • Cryptographic libraries and blockchain applications using bn.js for large integer operations

Discovery Timeline

  • 2026-02-20 - CVE-2026-2739 published to NVD
  • 2026-02-20 - Last updated in NVD database

Technical Details for CVE-2026-2739

Vulnerability Analysis

This vulnerability is classified as CWE-835 (Loop with Unreachable Exit Condition), commonly known as an infinite loop vulnerability. The flaw resides in the imaskn() method of the bn.js library, which is responsible for masking (zeroing out) bits above a specified position in a big number representation.

When maskn(0) is called, the method fails to properly handle the edge case where zero bits are requested to be masked. This results in the internal word array and length properties of the BN instance entering an inconsistent state. Subsequent operations that iterate over the internal representation—such as toString() for string conversion or divmod() for division operations—encounter loop conditions that can never be satisfied, causing the process to hang indefinitely.

The attack can be triggered remotely if user-controlled input influences the bit count parameter passed to maskn(). Since bn.js is commonly used in cryptographic operations, blockchain implementations, and financial calculations, the availability impact could be significant for affected applications.

Root Cause

The root cause lies in the imaskn() method's failure to validate and handle the edge case where the bits parameter equals zero. When bits is 0, the internal length property can be set to 0, creating an invalid internal state. The BN representation expects at least one word in the words array with length >= 1, but this invariant is violated when masking with zero bits.

Attack Vector

An attacker can exploit this vulnerability through any code path that allows user-controlled input to reach the maskn() method with a value of 0. This is particularly concerning in:

  1. Cryptographic operations - Where bit manipulation on user-provided values occurs
  2. Blockchain applications - Processing malicious transaction data
  3. API endpoints - That accept numeric parameters used in big number calculations
  4. Web3 applications - Handling user-submitted cryptographic proofs or signatures

The attack requires no authentication and can be executed remotely over the network against vulnerable applications.

javascript
// Security patch in lib/bn.js - fix imaskn state (#317)
       this.words[this.length - 1] &= mask;
     }
 
+    if (this.length === 0) {
+      this.words[0] = 0;
+      this.length = 1;
+    }
+
     return this._strip();
   };

Source: GitHub Commit Change

The patch adds a guard condition after the masking operation to ensure the BN instance maintains a valid internal state. When length becomes 0, it explicitly sets words[0] = 0 and length = 1, preserving the invariant that a BN instance always has at least one word.

Detection Methods for CVE-2026-2739

Indicators of Compromise

  • Application processes hanging indefinitely with high CPU usage
  • Node.js event loop blocked without apparent network or I/O activity
  • Stack traces showing repeated calls within bn.js toString() or divmod() methods
  • Memory consumption remaining static while CPU usage spikes to 100%

Detection Strategies

  • Monitor application processes for unresponsive states combined with sustained CPU usage
  • Implement dependency scanning to identify bn.js versions prior to 5.2.3 in your dependency tree
  • Use Software Composition Analysis (SCA) tools to flag vulnerable package versions
  • Set up application-level timeouts for cryptographic and arithmetic operations

Monitoring Recommendations

  • Configure process monitors to alert on Node.js processes exceeding CPU thresholds for extended periods
  • Implement watchdog timers around big number operations in critical code paths
  • Enable application performance monitoring (APM) to detect event loop blocking patterns
  • Set up alerts for service health checks failing due to unresponsive application endpoints

How to Mitigate CVE-2026-2739

Immediate Actions Required

  • Upgrade bn.js to version 5.2.3 or later immediately
  • Audit your package-lock.json or yarn.lock for transitive dependencies on vulnerable bn.js versions
  • If immediate patching is not possible, implement input validation to reject zero values for bit mask operations
  • Review application logs for any previous occurrences of hanging processes that may indicate exploitation attempts

Patch Information

The vulnerability has been addressed in bn.js version 5.2.3. The fix is available through the official commit and can be applied by updating the package. The patch ensures the internal state remains valid even when maskn(0) is called by explicitly setting minimum valid values for the word array.

Additional technical details are available in GitHub Issue #316 and GitHub Pull Request #317. The Snyk Vulnerability Report provides additional guidance for affected users.

Workarounds

  • Implement input validation wrappers around maskn() calls to reject zero values
  • Add timeout mechanisms around big number operations to prevent indefinite hangs
  • Use process isolation or worker threads for cryptographic operations to limit blast radius
  • Consider temporarily switching to alternative big number libraries if patching is not immediately feasible
bash
# Update bn.js to patched version
npm update bn.js@^5.2.3

# Or force resolution in package.json (npm)
npm pkg set overrides.bn.js="^5.2.3"

# For yarn, add resolution to package.json
# "resolutions": { "bn.js": "^5.2.3" }

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechBn.js

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-835
  • Technical References
  • GitHub Gist PoC

  • GitHub Commit Change

  • GitHub Issue #186

  • GitHub Issue #316

  • GitHub Pull Request #317

  • Snyk Vulnerability Report
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal 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