Miggo Logo

CVE-2021-29443: Padding Oracle Attack due to Observable Timing Discrepancy in jose

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.54157%
Published
4/19/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
josenpm>= 1.0.0, < 1.28.11.28.1
josenpm>= 2.0.0, < 2.0.52.0.5
josenpm>= 3.0.0, < 3.11.43.11.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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:

  1. The decrypt function in aes_cbc_hmac_sha2.js ran cipher.final() for CBC before checking macCheckPassed
  2. 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

jos* is *n npm li*r*ry provi*in* * num**r o* *rypto*r*p*i* op*r*tions. ### Imp**t [**S_***_*M**_S*** *l*orit*m](*ttps://tools.i*t*.or*/*tml/r******#s**tion-*.*) (*******-*S***, *******-*S***, *******-*S***) ***ryption woul* *lw*ys *x**ut* *ot* *M**

Reasoning

T** vuln*r**ility st*mm** *rom p*r*ormin* *** ***ryption (w*i** involv*s p***in* v*li**tion) ***OR* *M** v*ri*i**tion. *ll t*r** mo*i*i** *un*tions ori*in*lly *ont*in** t*is ins**ur* or**r: *. T** ***rypt *un*tion in **s_***_*m**_s***.js r*n *ip**r.*