CVE-2020-7735: OS Command Injection in ng-packagr

ng-packagr Updated 02 Oct 2025

Summary

07/05/2021
Yes i
Moderate
6.6

CVE-2020-7735: OS Command Injection in ng-packagr. Affects ng-packagr versions < 10.1.1. Fixed in 10.1.1. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

ng-packagr is an npm package used for compiling and packaging Angular libraries. It provides a command-line interface (CLI) for building and publishing Angular packages. The package is widely used in Angular projects to create reusable components and libraries. However, versions before 10.1.1 are vulnerable to OS Command Injection through the styleIncludePaths option.

Vulnerability Detail

The vulnerability in ng-packagr allows an attacker to execute arbitrary commands on the host system by injecting malicious commands through the styleIncludePaths option. This can lead to unauthorized access, data leakage, or even complete compromise of the host system. The vulnerability is rated as MODERATE severity with a CVSS score of 6.6. The Common Weakness Enumeration (CWE) ID associated with this vulnerability is CWE-78.

How To Fix

Minimum fixed version

10.1.1

This is the first release that contains the fix.

npm install ng-packagr@10.1.1

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

Workaround

If upgrading to the latest version is not immediately possible, a temporary workaround is to avoid using the styleIncludePaths option or ensure that user input is properly validated and sanitized before passing it to this option. Here is an example of how to sanitize user input in a Node.js application:

const { exec } = require('child_process');

function sanitizeInput(input) {
  // Implement input sanitization logic here
  return input.replace(/[;|&$<>]/g, '');
}

const styleIncludePaths = sanitizeInput(userInput);

exec(`ng-packagr --styleIncludePaths=${styleIncludePaths}`, (error, stdout, stderr) => {
  // Handle the command execution and output
});

Conclusion

In conclusion, the ng-packagr package before version 10.1.1 is vulnerable to OS Command Injection. It is crucial to upgrade to the latest version or apply the recommended workarounds to mitigate the risk of exploitation. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ng-packagr →

Share this vulnerability

FAQ

ng-packagr is an npm package used for compiling and packaging Angular libraries. It provides a CLI for building and publishing Angular packages.

The vulnerability allows an attacker to execute arbitrary commands on the host system, potentially leading to unauthorized access, data leakage, or complete compromise of the system.

The vulnerability is rated as MODERATE severity with a CVSS score of 6.6.

To fix this vulnerability, upgrade ng-packagr to version 10.1.1 or later. Alternatively, avoid using the styleIncludePaths option or properly sanitize user input before using it.

For more information about this vulnerability, refer to the GitHub Security Advisory GHSA-qm28-7hqv-wg5j.

How To Fix

Minimum fixed version

10.1.1

This is the first release that contains the fix.

npm install ng-packagr@10.1.1

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