CVE-2026-4598

jsrsasign: jsrsasign: Denial of Service via infinite loop in bnModInverse function with crafted inputs

Published Mar 23, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
Versions of the package jsrsasign before 11.1.1 are vulnerable to Infinite loop via the bnModInverse function in ext/jsbn2.js when the BigInteger.modInverse implementation receives zero or negative inputs, allowing an attacker to hang the process permanently by supplying such crafted values (e.g., modInverse(0, m) or modInverse(-1, m)).

Analysis

AI-generated

Technical impact

The bnModInverse function in the jsrsasign cryptographic library enters an infinite loop when its modulus argument is zero or negative. This causes the JavaScript event loop to stall, permanently hanging the Node.js process and preventing any new requests from being served. The underlying weakness is an infinite-loop bug (CWE‑835) combined with inadequate input validation (CWE‑1287).

Affected Systems

Any Node.js application that uses jsrsasign version 11.0.x or earlier is affected. The library is commonly included for JSON Web Token processing, RSA signature generation, and other cryptographic operations. The package’s CPE indicates deployment within the Node.js runtime, and the vendor is the jsrsasign_project organization. Upgrading to version 11.1.1 or later resolves the vulnerability by adding guard clauses against zero or negative modulus inputs.

Risk and Exploitability

The CVSS score of 8.7 marks this issue as high severity, while the EPSS score of less than 1% suggests the vulnerability has not yet attracted widespread exploitation; it is also not listed in the CISA KEV catalog. The likely attack vector is through any payloads or API endpoints that allow attackers to supply numeric values to jsrsasign routines, such as malicious JWT claims or user-controlled integers. By invoking modInverse(0, m) or modInverse(-1, m), the attacker can trigger the infinite loop and cause a denial of service. The risk is system-wide availability disruption until the affected process is restarted.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade jsrsasign to version 11.1.1 or later, as this release removes the infinite loop by validating the modulus input.
  • If an update is not immediately possible, apply the community patch that inserts a check for zero or negative modulus values before invoking bnModInverse, thereby preventing the endless loop.
  • Validate or sanitize all user-supplied numeric values before passing them to jsrsasign routines to ensure only positive, non-zero integers reach the cryptographic functions.
  • Audit the project’s dependency tree for any older jsrsasign releases and replace them with the fixed version or conduct the manual check described above.

Generated by OpenCVE AI on March 23, 2026 at 17:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-8g7p-jf3g-gxcp jsrsasign is vulnerable to DoS through Infinite Loop when processing zero or negative inputs
History
Type Values Removed Values Added
First Time appeared Jsrsasign Project
Jsrsasign Project jsrsasign
CPEs cpe:2.3:a:jsrsasign_project:jsrsasign:*:*:*:*:*:node.js:*:*
Vendors & Products Jsrsasign Project
Jsrsasign Project jsrsasign
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title jsrsasign: jsrsasign: Denial of Service via infinite loop in bnModInverse function with crafted inputs
Weaknesses CWE-1287
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
First Time appeared Kjur
Kjur jsrsasign
Vendors & Products Kjur
Kjur jsrsasign
Type Values Removed Values Added
Description Versions of the package jsrsasign before 11.1.1 are vulnerable to Infinite loop via the bnModInverse function in ext/jsbn2.js when the BigInteger.modInverse implementation receives zero or negative inputs, allowing an attacker to hang the process permanently by supplying such crafted values (e.g., modInverse(0, m) or modInverse(-1, m)).
Weaknesses CWE-835
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:P'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P'}

Weaknesses
  • CWE-1287

    Improper Validation of Specified Type of Input

  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')

Sources

Status
PUBLISHED
Assigner
snyk
Published
Updated
Sep 10, 2026, 12:04 PM
Reserved
Mar 22, 2026, 4:25 PM
Status
Modified
Published
Mar 23, 2026, 6:16 AM
Modified
Sep 10, 2026, 1:20 PM
Severity
Important
Public date
Mar 23, 2026, 5:00 AM