CVE-2021-29443: Jose Padding Oracle Attack Due To Vulnerability
MODERATECVE-2021-29443 is a MODERATE (CVSS 5.9) padding oracle attack due to vulnerability (CWE-203: Observable Discrepancy) affecting Jose libraries in the npm ecosystem. The issue involves padding oracle attack due to observable timing discrepancy in jose. Remediation is available by upgrading affected packages to version 1.28.1, 2.0.5, 3.11.4.
CVE-2021-29443 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-29443
To remediate this vulnerability, upgrade all affected Jose dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install jose@1.28.1
npm install jose@2.0.5
npm install jose@3.11.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls jose
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-29443, inspect your project dependencies using npm:
npm ls jose
Analyze the terminal output to locate any version of Jose in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.28.1), your application is affected.
Note: The npm ls jose command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. In Jose, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-29443 Affected Jose Versions
3 component(s)References
Frequently Asked Questions
What is CVE-2021-29443?
Which Jose versions are affected?
What version fixes CVE-2021-29443?
Is jose affected?
What is the CVSS score of CVE-2021-29443?
What CWE is associated with CVE-2021-29443?
How can I check npm dependencies for CVE-2021-29443?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-58f5-hfqc-jgch",
"modified" : "2021-04-16T23:01:38Z",
"published" : "2021-04-19T14:57:22Z",
"aliases" : [ "CVE-2021-29443" ],
"summary" : "Padding Oracle Attack due to Observable Timing Discrepancy in jose",
"details" : "jose is an npm library providing a number of cryptographic operations.\n### Impact\n\n[AES_CBC_HMAC_SHA2 Algorithm](https://tools.ietf.org/html/rfc7518#section-5.2) (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) decryption would always execute both HMAC tag verification and CBC decryption, if either failed `JWEDecryptionFailed` would be thrown. But a possibly observable difference in timing when padding error would occur while decrypting the ciphertext makes a padding oracle and an adversary might be able to make use of that oracle to decrypt data without knowing the decryption key by issuing on average 128*b calls to the padding oracle (where b is the number of bytes in the ciphertext block).\n\n### Patches\n\nAll major release versions have had a patch released which ensures the HMAC tag is verified before performing CBC decryption. The fixed versions are `^1.28.1 || ^2.0.5 || >=3.11.4`.\n\nUsers should upgrade their v1.x dependency to [`^1.28.1`](https://github.com/panva/jose/releases/tag/v1.28.1), their v2.x dependency to [`^2.0.5`](https://github.com/panva/jose/releases/tag/v2.0.5), and their v3.x dependency to [`^3.11.4`](https://github.com/panva/jose/releases/tag/v3.11.4)\n\n### Credits\nThanks to Morgan Brown of Microsoft for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "jose"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.28.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "jose"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "jose"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.11.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/panva/jose/security/advisories/GHSA-58f5-hfqc-jgch"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29443"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/jose"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-203", "CWE-696" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-16T23:01:38Z",
"nvd_published_at" : "2021-04-16T18:15:00Z"
}
}