Remote Code Injection Affecting convert-svg-core Open this link in a new tab package, versions <0.6.2


0.0
critical
  • Exploit Maturity

    Proof of concept

  • Attack Complexity

    Low

  • Scope

    Changed

  • Confidentiality

    High

  • Integrity

    High

  • Availability

    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-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');
});