CVE-2021-29444: Jose browser runtime Padding Oracle Attack Due To Vulnerability

MODERATE
Advisory Identifier: GHSA-94hh-pjjg-rwmr
CVSS 5.9
CWE-203
Published
Advisory Summary

CVE-2021-29444 is a MODERATE (CVSS 5.9) padding oracle attack due to vulnerability (CWE-203: Observable Discrepancy) affecting Jose browser runtime libraries in the npm ecosystem. The issue involves padding oracle attack due to observable timing discrepancy in jose-browser-runtime. Remediation is available by upgrading affected packages to version 3.11.4.

CVE-2021-29444 at a Glance

CVE Identifier CVE-2021-29444
GHSA Identifier GHSA-94hh-pjjg-rwmr
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-203: Observable Discrepancy
Affected Product Jose browser runtime
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-29444

To remediate this vulnerability, upgrade all affected Jose browser runtime dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jose-browser-runtime fixed: 3.11.4
npm install jose-browser-runtime@3.11.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jose-browser-runtime

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-29444, inspect your project dependencies using npm:

npm ls jose-browser-runtime

Analyze the terminal output to locate any version of Jose browser runtime in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.11.4), your application is affected.

Note: The npm ls jose-browser-runtime 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 browser runtime, 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

### Impact [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). ### Patches A patch was released which ensures the HMAC tag is verified before performing CBC decryption. The fixed versions are `>=3.11.4`. Users should upgrade to `^3.11.4`. ### Credits Thanks to Morgan Brown of Microsoft for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.

CVE-2021-29444 Affected Jose browser runtime Versions

1 component(s)
Fixed Versions:
3.11.4
Product / Package Ecosystem Affected Versions Fixed Version
jose-browser-runtime
npm
< 3.11.4
3.11.4

References

Frequently Asked Questions

What is CVE-2021-29444?
CVE-2021-29444 is a security vulnerability in Jose browser runtime involving Padding Oracle Attack due to Observable Timing Discrepancy in jose-browser-runtime under CWE-203: Observable Discrepancy.
Which Jose browser runtime versions are affected?
Affected versions include releases prior to 3.11.4 across affected packages: jose-browser-runtime.
What version fixes CVE-2021-29444?
Upgrading to 3.11.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jose-browser-runtime affected?
Yes, jose-browser-runtime is affected in releases prior to 3.11.4. Upgrade your dependency to 3.11.4 or later.
What is the CVSS score of CVE-2021-29444?
CVE-2021-29444 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-29444?
CVE-2021-29444 is classified under CWE-203: Observable Discrepancy (The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.).
How can I check npm dependencies for CVE-2021-29444?
Run the dependency tree command: 'npm ls jose-browser-runtime'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-94hh-pjjg-rwmr",
  "modified" : "2023-03-17T17:49:50Z",
  "published" : "2021-04-19T14:58:49Z",
  "aliases" : [ "CVE-2021-29444" ],
  "summary" : "Padding Oracle Attack due to Observable Timing Discrepancy in jose-browser-runtime",
  "details" : "### 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\nA patch was released which ensures the HMAC tag is verified before performing CBC decryption. The fixed versions are `>=3.11.4`.\n\nUsers should upgrade to `^3.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-browser-runtime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.11.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/panva/jose/security/advisories/GHSA-94hh-pjjg-rwmr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29444"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/panva/jose"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/jose-browser-runtime"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-203" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-04-16T23:00:49Z",
    "nvd_published_at" : "2021-04-16T22:15:00Z"
  }
}