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)).
Published: 2026-03-23
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service
Action: Immediate Patch
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Mon, 23 Mar 2026 16:30:00 +0000

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

Mon, 23 Mar 2026 15:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Mon, 23 Mar 2026 12:15:00 +0000

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


Mon, 23 Mar 2026 10:00:00 +0000

Type Values Removed Values Added
First Time appeared Kjur
Kjur jsrsasign
Vendors & Products Kjur
Kjur jsrsasign

Mon, 23 Mar 2026 05:45:00 +0000

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'}


Subscriptions

Jsrsasign Project Jsrsasign
Kjur Jsrsasign
cve-icon MITRE

Status: PUBLISHED

Assigner: snyk

Published:

Updated: 2026-03-23T14:37:09.505Z

Reserved: 2026-03-22T16:25:51.590Z

Link: CVE-2026-4598

cve-icon Vulnrichment

Updated: 2026-03-23T14:37:07.011Z

cve-icon NVD

Status : Analyzed

Published: 2026-03-23T06:16:21.300

Modified: 2026-03-23T16:18:04.410

Link: CVE-2026-4598

cve-icon Redhat

Severity : Important

Publid Date: 2026-03-23T05:00:11Z

Links: CVE-2026-4598 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-03-25T14:49:50Z

Weaknesses