CVE-2024-34273: njwt Prototype Pollution vulnerability
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.25998%
CWE
Published
5/16/2024
Updated
11/18/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| njwt | npm | < 2.0.1 | 2.0.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key points: 1) Parser.prototype.parse processes raw JWT headers and passes them to JwtHeader without the 'enforceDefaultFields=false' parameter pre-patch, allowing prototype pollution vectors. 2) The JwtHeader constructor's original implementation stored critical security configuration (reservedKeys) in the prototype, making it susceptible to pollution via malicious proto properties in JWT headers. The commit fixes both by freezing prototypes and moving reservedKeys to a local variable. The PoC demonstrates pollution through these entry points, and the patch directly modifies these functions.