CVE-2022-24429: Convert svg core Code Injection Vulnerability

HIGH
Advisory Identifier: GHSA-54px-mhwv-5v8x
CVSS 8.6
CWE-94 CWE-74
Published
Advisory Summary

CVE-2022-24429 is a HIGH (CVSS 8.6) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Convert svg core libraries in the npm ecosystem. The issue involves code injection via svg file in convert-svg-core. Remediation is available by upgrading affected packages to version 0.6.3.

CVE-2022-24429 at a Glance

CVE Identifier CVE-2022-24429
GHSA Identifier GHSA-54px-mhwv-5v8x
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Convert svg core
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.6

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:L/I:L/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 Low (C:L)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2022-24429

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

convert-svg-core fixed: 0.6.3
npm install convert-svg-core@0.6.3
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 convert-svg-core

How to Check if You Are Affected

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

npm ls convert-svg-core

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

Note: The npm ls convert-svg-core 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Convert svg core, 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

The package convert-svg-core before 0.6.3 are vulnerable to Arbitrary Code Injection when using a specially crafted SVG file. An attacker can read arbitrary files from the file system and then show the file content as a converted PNG file.

CVE-2022-24429 Affected Convert svg core Versions

1 component(s)
Fixed Versions:
0.6.3
Product / Package Ecosystem Affected Versions Fixed Version
convert-svg-core
npm
< 0.6.3
0.6.3

References

Frequently Asked Questions

What is CVE-2022-24429?
CVE-2022-24429 is a security vulnerability in Convert svg core involving Code injection via SVG file in convert-svg-core under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Convert svg core versions are affected?
Affected versions include releases prior to 0.6.3 across affected packages: convert-svg-core.
What version fixes CVE-2022-24429?
Upgrading to 0.6.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is convert-svg-core affected?
Yes, convert-svg-core is affected in releases prior to 0.6.3. Upgrade your dependency to 0.6.3 or later.
What is the CVSS score of CVE-2022-24429?
CVE-2022-24429 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H.
What CWE is associated with CVE-2022-24429?
CVE-2022-24429 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2022-24429?
Run the dependency tree command: 'npm ls convert-svg-core'. 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-54px-mhwv-5v8x",
  "modified" : "2022-06-17T00:55:34Z",
  "published" : "2022-06-11T00:00:17Z",
  "aliases" : [ "CVE-2022-24429" ],
  "summary" : "Code injection via SVG file in convert-svg-core",
  "details" : "The package convert-svg-core before 0.6.3 are vulnerable to Arbitrary Code Injection when using a specially crafted SVG file. An attacker can read arbitrary files from the file system and then show the file content as a converted PNG file.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "convert-svg-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24429"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/neocotic/convert-svg/issues/84"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/neocotic/convert-svg/commit/a43dffaab0f1e419d5be84e2e7356b86ffac3cf1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/neocotic/convert-svg"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-CONVERTSVGCORE-2859212"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-17T00:55:34Z",
    "nvd_published_at" : "2022-06-10T20:15:00Z"
  }
}