CVE-2023-4421
Medium · 6.5CVSS
6.5
EPSS
0.8%
Published
Dec 12, 2023
CISA due date
—
Cloudanix analysis
A flaw in widely used cryptographic software could let attackers read encrypted messages or impersonate digital signatures by sending many test messages and watching how long each one takes to process.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Library
- Class
- Cryptographic Weakness
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Timing side-channel in PKCS#1 v1.5 padding validation leaks both overall padding correctness and plaintext length, enabling recovery of RSA-encrypted messages or signature forgery via chosen-ciphertext attacks.
Why it matters to the business
Attackers could decrypt previously captured TLS sessions that used RSA key exchange or forge signatures with the victim's private key, undermining encrypted communications and code or message authenticity across any product using the vulnerable NSS library.
How an attack unfolds
An attacker intercepts an RSA-encrypted TLS session, then sends thousands of carefully crafted ciphertexts to the target NSS instance while measuring response timing differences; the leaked padding validity and length information is used to mount a Bleichenbacher-style oracle attack that eventually recovers the session key or forges a signature.
How to fix it
Upgrade Mozilla NSS to version 3.61 or later, which implements the implicit-rejection (constant-time) padding check; rebuild and redeploy all dependent applications and libraries.
How to confirm the fix worked
Verify installed NSS version is 3.61 or higher; run the Marvin Attack test vectors or constant-time padding test suites against the library; confirm no timing variance is observable across valid/invalid PKCS#1 v1.5 inputs.
Typical attack path
- Intercept RSA-encrypted ciphertext (e.g., TLS handshake)
- Send large volume of attacker-chosen probe ciphertexts to vulnerable NSS endpoint
- Measure timing side-channel responses to classify padding validity and length
- Iteratively recover plaintext bytes or construct a valid signature forgery
How to detect it
Search application and TLS termination logs for unusually high rates of RSA decryption or signature verification calls returning padding errors; correlate with external network traffic showing repeated connections from the same source sending malformed ciphertexts.
What your security team should do
- Immediately inventory all systems and containers using NSS and schedule upgrade to 3.61+
- Replace RSA key exchange with ECDHE or other forward-secret cipher suites where possible
- Add monitoring for high volumes of RSA decryption operations with invalid padding
- Review and rotate any long-lived RSA private keys that may have been exposed to the vulnerability window
The record
The NSS code used for checking PKCS#1 v1.5 was leaking information useful in mounting Bleichenbacher-like attacks. Both the overall correctness of the padding as well as the length of the encrypted message was leaking through timing side-channel. By sending large number of attacker-selected ciphertexts, the attacker would be able to decrypt a previously intercepted PKCS#1 v1.5 ciphertext (for example, to decrypt a TLS session that used RSA key exchange), or forge a signature using the victim's key. The issue was fixed by implementing the implicit rejection algorithm, in which the NSS returns a deterministic random message in case invalid padding is detected, as proposed in the Marvin Attack paper. This vulnerability affects NSS < 3.61.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | nss | 0 | 2:3.42.1-1+deb10u7 |
| Debian:11 | nss | 0 | 2:3.61-1 |
| Debian:12 | nss | 0 | 2:3.61-1 |
| Debian:13 | nss | 0 | 2:3.61-1 |
| Ubuntu:18.04:LTS | nss | 0 | No fix |
| Ubuntu:20.04:LTS | nss | 0 | 2:3.98-0ubuntu0.20.04.1 |
| Ubuntu:22.04:LTS | nss | 0 | 2:3.68.2-0ubuntu1.2 |
| Ubuntu:22.04:LTS | nss | 0 | 2:3.98-0ubuntu0.22.04.1 |
| Ubuntu:23.10 | nss | 0 | 2:3.98-0ubuntu0.23.10.1 |
| Ubuntu:24.04:LTS | nss | 0 | 2:3.92-1 |
| Ubuntu:Pro:14.04:LTS | nss | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | nss | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | nss | 0 | No fix |
Related vulnerabilities
- CVE-2024-0743 An unchecked return value in TLS handshake code could have caused a potentially… Also affects nss
- CVE-2023-0767 An attacker could construct a PKCS 12 cert bundle in such a way that could allow for… Also affects nss
- CVE-2022-22747 After accepting an untrusted certificate, handling an empty pkcs7 sequence as part of the… Also affects nss
- CVE-2019-17007 In Network Security Services before 3.44, a malformed Netscape Certificate Sequence can… Also affects nss
- CVE-2019-17006 In Network Security Services (NSS) before 3.46, several cryptographic primitives had… Also affects nss
- CVE-2020-12400 When converting coordinates from projective to affine, the modular inversion was not… Also affects nss
- CVE-2020-12399 NSS has shown timing differences when performing DSA signatures, which was exploitable… Also affects nss
- CVE-2024-7531 Calling `PK11_Encrypt()` in NSS using CKM_CHACHA20 and the same buffer for input and… Also affects nss