CVE-2026-4598 Overview
CVE-2026-4598 is a Denial of Service vulnerability affecting the jsrsasign cryptographic library for Node.js. Versions of the package before 11.1.1 are vulnerable to an infinite loop via the bnModInverse function in ext/jsbn2.js. When the BigInteger.modInverse implementation receives zero or negative inputs, an attacker can hang the process permanently by supplying crafted values such as modInverse(0, m) or modInverse(-1, m).
Critical Impact
Applications using vulnerable versions of jsrsasign can be rendered completely unresponsive through malicious input, causing service outages for cryptographic operations dependent on modular inverse calculations.
Affected Products
- jsrsasign versions prior to 11.1.1
- Node.js applications utilizing the vulnerable jsrsasign package
- Web applications implementing jsrsasign for cryptographic operations
Discovery Timeline
- 2026-03-23 - CVE-2026-4598 published to NVD
- 2026-03-23 - Last updated in NVD database
Technical Details for CVE-2026-4598
Vulnerability Analysis
The vulnerability resides in the bnModInverse function within the ext/jsbn2.js file of the jsrsasign library. This function is responsible for computing the modular multiplicative inverse, a fundamental cryptographic operation used in various algorithms including RSA key generation and digital signature schemes.
The root cause is an improper input validation flaw (CWE-835: Loop with Unreachable Exit Condition) where the function fails to validate that input values are positive integers before entering its computational loop. When zero or negative values are passed to the function, the algorithm enters an infinite loop because the termination condition can never be satisfied with these edge-case inputs.
Root Cause
The BigInteger.modInverse implementation lacks boundary checks for zero and negative input values. The modular inverse operation is mathematically undefined for zero (since 0 has no multiplicative inverse) and the implementation does not handle negative integers appropriately. Without proper input validation at the function entry point, the extended Euclidean algorithm used internally loops indefinitely, never reaching its exit condition.
Attack Vector
An attacker can exploit this vulnerability remotely over the network without requiring authentication or user interaction. The attack involves supplying specially crafted input values to any application endpoint that processes user-controlled data through the modInverse function. This could occur in:
- Certificate validation routines
- Digital signature verification
- Custom cryptographic implementations using jsrsasign's BigInteger library
- Any API endpoint accepting numeric input for cryptographic operations
The vulnerability allows an attacker to trigger the infinite loop by supplying values like modInverse(0, m) or modInverse(-1, m) where m is any modulus value. Once triggered, the affected Node.js process becomes permanently unresponsive, effectively denying service to all users of the application.
For technical details on the vulnerability mechanism, refer to the GitHub Gist PoC and the GitHub Pull Request Discussion.
Detection Methods for CVE-2026-4598
Indicators of Compromise
- Node.js processes consuming 100% CPU indefinitely without completing requests
- Application health checks failing due to unresponsive server threads
- Increasing memory consumption in processes handling cryptographic operations
- Request timeouts occurring specifically on endpoints utilizing modular arithmetic functions
Detection Strategies
- Monitor application performance metrics for sudden CPU spikes correlated with specific API calls
- Implement request logging to identify patterns of zero or negative values being submitted to cryptographic endpoints
- Use application performance monitoring (APM) tools to detect hanging requests in cryptographic code paths
- Set up dependency scanning to identify jsrsasign versions below 11.1.1 in your software supply chain
Monitoring Recommendations
- Configure alerting for Node.js process CPU utilization exceeding normal thresholds for extended periods
- Implement request timeout monitoring to detect endpoints that fail to respond
- Enable process-level monitoring to identify processes stuck in infinite loops
- Deploy SentinelOne Singularity Platform for real-time detection of anomalous process behavior and denial of service conditions
How to Mitigate CVE-2026-4598
Immediate Actions Required
- Upgrade jsrsasign to version 11.1.1 or later immediately
- Audit application code to identify all uses of BigInteger.modInverse function
- Implement input validation to reject zero and negative values before they reach the vulnerable function
- Consider implementing request timeouts as a defensive measure against similar DoS vulnerabilities
Patch Information
The jsrsasign project has addressed this vulnerability in version 11.1.1. The fix adds proper input validation to the bnModInverse function to check for zero and negative inputs before processing. For details on the patch implementation, see the GitHub Commit Update. Additional technical information is available in the Snyk Vulnerability Advisory.
Workarounds
- Implement application-level input validation to reject zero and negative values before calling cryptographic functions
- Deploy a Web Application Firewall (WAF) rule to filter requests containing suspicious numeric values targeting cryptographic endpoints
- Configure process-level timeouts to automatically restart hung processes
- Isolate cryptographic operations in separate worker processes to limit the impact of a DoS attack on the main application
# Update jsrsasign to patched version
npm update jsrsasign@11.1.1
# Or specify in package.json
# "jsrsasign": ">=11.1.1"
# Verify installed version
npm list jsrsasign
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


