CVE-2021-3749: Axios Axios Inefficient Regular Expression Complexity Vulnerability

HIGH
Advisory Identifier: GHSA-cph5-m8f7-6c5x
CVSS 7.5
CWE-400 CWE-1333
Published
Advisory Summary

CVE-2021-3749 is a HIGH (CVSS 7.5) axios inefficient regular expression complexity vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Axios libraries in the npm ecosystem. The issue involves axios inefficient regular expression complexity vulnerability. Remediation is available by upgrading affected packages to version 0.21.2.

CVE-2021-3749 at a Glance

CVE Identifier CVE-2021-3749
GHSA Identifier GHSA-cph5-m8f7-6c5x
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Axios
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2021-3749

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

axios fixed: 0.21.2
npm install axios@0.21.2
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 axios

How to Check if You Are Affected

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

npm ls axios

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

Note: The npm ls axios 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Axios, 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

axios before v0.21.2 is vulnerable to Inefficient Regular Expression Complexity.

CVE-2021-3749 Affected Axios Versions

1 component(s)
Fixed Versions:
0.21.2
Product / Package Ecosystem Affected Versions Fixed Version
axios
npm
< 0.21.2
0.21.2

References

NVD — CVE-2021-3749 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-3749
Security Fix Commit FIX COMMIT
https://github.com/axios/axios/commit/5b457116e31db0e88fede6c428e969e87f290929
Axios Security Information SECURITY
https://www.oracle.com/security-alerts/cpujul2022.html
www.npmjs.com/package/axios WEB
https://www.npmjs.com/package/axios
lists.apache.org/thread.html/rfc5c47... WEB
https://lists.apache.org/thread.html/rfc5c478053ff808671aef170f3d9fc9d05cc1fab8fb64431edc66103@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/rfa0940... WEB
https://lists.apache.org/thread.html/rfa094029c959da0f7c8cd7dc9c4e59d21b03457bf0cedf6c93e1bb0a@%3Cdev.druid.apache.org%3E
lists.apache.org/thread.html/rc263bf... WEB
https://lists.apache.org/thread.html/rc263bfc5b53afcb7e849605478d73f5556eb0c00d1f912084e407289@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/ra15d63... WEB
https://lists.apache.org/thread.html/ra15d63c54dc6474b29f72ae4324bcb03038758545b3ab800845de7a1@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r74d0b3... WEB
https://lists.apache.org/thread.html/r74d0b359408fff31f87445261f0ee13bdfcac7d66f6b8e846face321@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r7324ec... WEB
https://lists.apache.org/thread.html/r7324ecc35b8027a51cb6ed629490fcd3b2d7cf01c424746ed5744bf1@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r4bf1b3... WEB
https://lists.apache.org/thread.html/r4bf1b32983f50be00f9752214c1b53738b621be1c2b0dbd68c7f2391@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r3ae6d2... WEB
https://lists.apache.org/thread.html/r3ae6d2654f92c5851bdb73b35e96b0e4e3da39f28ac7a1b15ae3aab8@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r216f0f... WEB
https://lists.apache.org/thread.html/r216f0fd0a3833856d6a6a1fada488cadba45f447d87010024328ccf2@%3Ccommits.druid.apache.org%3E
lists.apache.org/thread.html/r075d46... WEB
https://lists.apache.org/thread.html/r075d464dce95cd13c03ff9384658edcccd5ab2983b82bfc72b62bb10@%3Ccommits.druid.apache.org%3E
huntr.dev/bounties/1e8f07fc-c... WEB
https://huntr.dev/bounties/1e8f07fc-c384-4ff9-8498-0690de2e8c31
Axios Source Repository REPOSITORY
https://github.com/axios/axios
cert-portal.siemens.com/productcert/pdf/ssa... WEB
https://cert-portal.siemens.com/productcert/pdf/ssa-637483.pdf

Frequently Asked Questions

What is CVE-2021-3749?
CVE-2021-3749 is a security vulnerability in Axios involving axios Inefficient Regular Expression Complexity vulnerability under CWE-400: Uncontrolled Resource Consumption.
Which Axios versions are affected?
Affected versions include releases prior to 0.21.2 across affected packages: axios.
What version fixes CVE-2021-3749?
Upgrading to 0.21.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is axios affected?
Yes, axios is affected in releases prior to 0.21.2. Upgrade your dependency to 0.21.2 or later.
What is the CVSS score of CVE-2021-3749?
CVE-2021-3749 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-3749?
CVE-2021-3749 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2021-3749?
Run the dependency tree command: 'npm ls axios'. 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-cph5-m8f7-6c5x",
  "modified" : "2022-09-14T21:28:32Z",
  "published" : "2021-09-01T18:23:02Z",
  "aliases" : [ "CVE-2021-3749" ],
  "summary" : "axios Inefficient Regular Expression Complexity vulnerability",
  "details" : "axios before v0.21.2 is vulnerable to Inefficient Regular Expression Complexity.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "axios"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.21.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3749"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/axios/axios/commit/5b457116e31db0e88fede6c428e969e87f290929"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/axios"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rfc5c478053ff808671aef170f3d9fc9d05cc1fab8fb64431edc66103@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rfa094029c959da0f7c8cd7dc9c4e59d21b03457bf0cedf6c93e1bb0a@%3Cdev.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc263bfc5b53afcb7e849605478d73f5556eb0c00d1f912084e407289@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/ra15d63c54dc6474b29f72ae4324bcb03038758545b3ab800845de7a1@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r74d0b359408fff31f87445261f0ee13bdfcac7d66f6b8e846face321@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r7324ecc35b8027a51cb6ed629490fcd3b2d7cf01c424746ed5744bf1@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r4bf1b32983f50be00f9752214c1b53738b621be1c2b0dbd68c7f2391@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r3ae6d2654f92c5851bdb73b35e96b0e4e3da39f28ac7a1b15ae3aab8@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r216f0fd0a3833856d6a6a1fada488cadba45f447d87010024328ccf2@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r075d464dce95cd13c03ff9384658edcccd5ab2983b82bfc72b62bb10@%3Ccommits.druid.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/1e8f07fc-c384-4ff9-8498-0690de2e8c31"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/axios/axios"
  }, {
    "type" : "WEB",
    "url" : "https://cert-portal.siemens.com/productcert/pdf/ssa-637483.pdf"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333", "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-01T18:14:02Z",
    "nvd_published_at" : "2021-08-31T11:15:00Z"
  }
}