# CVE-2026-4603: jsrsasign division by zero in RSA public key parsing

Source: https://junglewise.ai/threats/cve-2026-4603-jsrsasign-division-by-zero-in-rsa-public-key-parsing  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-23. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-4603 · Severity: medium · CVSS 5.9 · Published 2026-03-23

jsrsasign is a JavaScript library used to perform RSA cryptographic operations like signature verification and encryption. A flaw allows an attacker to import a malformed RSA public key with a zero modulus, causing all subsequent RSA operations to produce incorrect (often zero) outputs. This breaks the ability to distinguish between a legitimate cryptographic failure and a deliberate key substitution attack, undermining the security of systems that rely on RSA verification or encryption.

Technologies: [jsrsasign (npm)](https://junglewise.ai/threats/technologies/jsrsasign). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-4603 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-4603 being exploited in the wild.

**How severe is CVE-2026-4603?** Medium severity, with a CVSS score of 5.9, published 23 March 2026.

**Which products and versions are affected?** jsrsasign (npm) SEMVER:introduced=0,fixed=11.1.1.

**Is there a fix for CVE-2026-4603?** Yes. jsrsasign (npm): upgrade to 11.1.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-4603 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-4603?** Check whether you run jsrsasign (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- jsrsasign (npm): upgrade to 11.1.1 or later

  ```sh
  npm install jsrsasign@11.1.1
  ```


## Technical details

The vulnerability is a division-by-zero condition (CWE-369) compounded with improper input validation (CWE-20). The RSASetPublic/KEYUTIL.getKey() parsing path in ext/rsa.js validates only the string length of JWK parameters, not their numeric value, allowing a JWK with modulus n=0 to be imported. The BigInteger.modPowInt reduction logic in ext/jsbn.js then silently handles division by zero by returning 0 rather than throwing an exception, causing all RSA public-key operations to produce deterministic zero outputs. An attacker who can supply or influence the RSA public key (via JWKS endpoints, JWK headers, or compromised certificate sources) can inject a zero-modulus key without detection at import time. The observable impact varies by calling API: some RSA operations return a normal failure value (e.g., verify() === false), while others may throw later during padding/encoding, making it difficult to distinguish "invalid key" from "legitimate cryptographic failure." This particularly undermines systems where the attacker controls the public key (encryption contexts or BYOK flows). A patch is available in version 11.1.1.

## Affected products

- kjur jsrsasign before 11.1.1

## Identifiers

- CVE-2026-4603
- GHSA-464q-cqxq-xhgr

## Timeline

- 2026-02-18: disclosed: Vulnerability details disclosed via GitHub gist
- 2026-02-20: patched: Fix merged in GitHub PR #649
- 2026-03-23: advisory: CVE-2026-4603 and GHSA-464q-cqxq-xhgr published

## References

- [https://github.com/kjur/jsrsasign/pull/649](https://github.com/kjur/jsrsasign/pull/649)
- [https://github.com/kjur/jsrsasign/commit/dc41d49fac4297e7a737a3ef8ebd0aa9c49ef93f](https://github.com/kjur/jsrsasign/commit/dc41d49fac4297e7a737a3ef8ebd0aa9c49ef93f)
- [https://gist.github.com/Kr0emer/5366b7364c4fbf7e754bc377f321e9f3](https://gist.github.com/Kr0emer/5366b7364c4fbf7e754bc377f321e9f3)
- [https://github.com/kjur/jsrsasign](https://github.com/kjur/jsrsasign)
- [https://security.snyk.io/vuln/SNYK-JS-JSRSASIGN-15371176](https://security.snyk.io/vuln/SNYK-JS-JSRSASIGN-15371176)

## Related threats

- [jsrsasign incorrect numeric conversion in BigInteger modPow](https://junglewise.ai/threats/cve-2026-4602-jsrsasign-incorrect-numeric-conversion-in-biginteger-modpow)
- [jsrsasign private key recovery via missing DSA check in signWithMessageHash](https://junglewise.ai/threats/cve-2026-4601-jsrsasign-private-key-recovery-via-missing-dsa-check-in)
- [kjur jsrsasign signature forgery via DSA domain parameter validation](https://junglewise.ai/threats/cve-2026-4600-kjur-jsrsasign-signature-forgery-via-dsa-domain-parameter)
- [jsrsasign private key recovery via biased DSA nonce generation](https://junglewise.ai/threats/cve-2026-4599-jsrsasign-private-key-recovery-via-biased-dsa-nonce-generation)
- [jsrsasign infinite loop in BigInteger.modInverse](https://junglewise.ai/threats/cve-2026-4598-jsrsasign-infinite-loop-in-biginteger-modinverse)
