CVE-2021-29059: Is svg Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-r8j5-h5cx-65gg
CVSS 7.5
CWE-770
Published
Advisory Summary

CVE-2021-29059 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Is svg libraries in the npm ecosystem. The issue involves redos in is-svg. Remediation is available by upgrading affected packages to version 4.3.0.

CVE-2021-29059 at a Glance

CVE Identifier CVE-2021-29059
GHSA Identifier GHSA-r8j5-h5cx-65gg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Is svg
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-29059

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

is-svg fixed: 4.3.0
npm install is-svg@4.3.0
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 is-svg

How to Check if You Are Affected

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

npm ls is-svg

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

Note: The npm ls is-svg 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Is svg, 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

A vulnerability was discovered in IS-SVG version 4.3.1 and below where a Regular Expression Denial of Service (ReDOS) occurs if the application is provided and checks a crafted invalid SVG string.

CVE-2021-29059 Affected Is svg Versions

1 component(s)
Fixed Versions:
4.3.0
Product / Package Ecosystem Affected Versions Fixed Version
is-svg
npm
≥ 2.1.0
< 4.3.0
4.3.0

References

Frequently Asked Questions

What is CVE-2021-29059?
CVE-2021-29059 is a security vulnerability in Is svg involving ReDOS in IS-SVG under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Is svg versions are affected?
Affected versions include releases prior to 4.3.0 across affected packages: is-svg.
What version fixes CVE-2021-29059?
Upgrading to 4.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is is-svg affected?
Yes, is-svg is affected in releases prior to 4.3.0. Upgrade your dependency to 4.3.0 or later.
What is the CVSS score of CVE-2021-29059?
CVE-2021-29059 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-29059?
CVE-2021-29059 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check npm dependencies for CVE-2021-29059?
Run the dependency tree command: 'npm ls is-svg'. 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-r8j5-h5cx-65gg",
  "modified" : "2021-12-10T19:02:24Z",
  "published" : "2021-12-10T19:02:37Z",
  "aliases" : [ "CVE-2021-29059" ],
  "summary" : "ReDOS in IS-SVG",
  "details" : "A vulnerability was discovered in IS-SVG version 4.3.1 and below where a Regular Expression Denial of Service (ReDOS) occurs if the application is provided and checks a crafted invalid SVG string.",
  "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" : "is-svg"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "4.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29059"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sindresorhus/is-svg/commit/732fc72779840c45a30817d3fe28e12058592b02"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sindresorhus/is-svg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sindresorhus/is-svg/releases/tag/v4.3.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yetingli/PoCs/blob/main/CVE-2021-29059/IS-SVG.md"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yetingli/SaveResults/blob/main/js/is-svg.js"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/is-svg"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-22T15:40:38Z",
    "nvd_published_at" : "2021-06-21T16:15:00Z"
  }
}