CVE-2021-29443: Padding Oracle Attack due to Observable Timing Discrepancy in jose
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.54157%
CWE
Published
4/19/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
jose | npm | >= 1.0.0, < 1.28.1 | 1.28.1 |
jose | npm | >= 2.0.0, < 2.0.5 | 2.0.5 |
jose | npm | >= 3.0.0, < 3.11.4 | 3.11.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from performing CBC decryption (which involves padding validation) BEFORE HMAC verification. All three modified functions originally contained this insecure order:
- The decrypt function in aes_cbc_hmac_sha2.js ran cipher.final() for CBC before checking macCheckPassed
- Both browser/node cbcDecrypt implementations executed crypto.subtle.decrypt/createDecipheriv before MAC validation This sequence allowed attackers to observe timing differences from padding errors during CBC operations before MAC validation occurred. The patches moved MAC checks before any CBC decryption steps.