CVE-2019-10799: OS Command Injection in compile-sass

compile-sass Updated 02 Oct 2025

Summary

13/04/2021
Yes i
High
9.8

CVE-2019-10799: OS Command Injection in compile-sass. Affects compile-sass versions < 1.0.5. Fixed in 1.0.5. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

compile-sass is an npm package used for compiling Sass files. It provides a function called 'setupCleanupOnExit(cssPath)' within the 'dist/index.js' file. This function is responsible for executing the 'rm' command without proper sanitization. Due to this vulnerability, an attacker can inject arbitrary commands, leading to potential remote code execution.

Vulnerability Detail

The vulnerability in compile-sass allows an attacker to execute arbitrary commands through the 'setupCleanupOnExit(cssPath)' function. Since the 'rm' command is executed without sanitization, an attacker can inject malicious commands and potentially gain unauthorized access to the system. This vulnerability has a CVSS score of 9.8 (Critical) and is classified as CWE-78 (Improper Neutralization of Special Elements used in an OS Command).

How To Fix

Minimum fixed version

1.0.5

This is the first release that contains the fix.

npm install compile-sass@1.0.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can avoid using the 'setupCleanupOnExit(cssPath)' function or modify it to properly sanitize the input before executing the 'rm' command. Here's an example of how you can sanitize the input using the 'shell-quote' package:

const shellQuote = require('shell-quote');

function setupCleanupOnExit(cssPath) {
  const sanitizedPath = shellQuote.quote([cssPath]);
  // Rest of the function implementation
}

Conclusion

The OS Command Injection vulnerability in compile-sass allows an attacker to execute arbitrary commands, potentially leading to unauthorized access and remote code execution. It is crucial to update the package to version 1.0.5 or later to mitigate this vulnerability. If you have any further questions or need assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for compile-sass →

Share this vulnerability

FAQ

compile-sass is an npm package used for compiling Sass files. It provides a convenient way to convert Sass code into CSS.

This vulnerability allows an attacker to execute arbitrary commands on the system where compile-sass is being used. This can lead to unauthorized access, data breaches, and potential remote code execution.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will analyze it for any open-source vulnerabilities, including this one.

Yes, the fix for this vulnerability is to update the compile-sass package to version 1.0.5 or later. This version includes the necessary fixes to prevent command injection.

As a temporary workaround, you can avoid using the 'setupCleanupOnExit(cssPath)' function or modify it to properly sanitize the input before executing the 'rm' command. Please refer to the 'workaround' section for an example.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.0.5

This is the first release that contains the fix.

npm install compile-sass@1.0.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback