CVE-2020-7631: OS Command Injection in diskusage-ng

diskusage-ng Updated 02 Oct 2025

Summary

07/01/2022
No i
Critical
9.8

CVE-2020-7631: OS Command Injection in diskusage-ng. Affects diskusage-ng versions < 0.2.4. No fix is published. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

diskusage-ng is an npm package that provides disk usage information for a given path. It allows users to retrieve disk usage statistics and analyze disk space consumption. However, versions up to 0.2.4 are vulnerable to OS Command Injection. This vulnerability enables an attacker to execute arbitrary commands by manipulating the path argument.

Vulnerability Detail

The OS Command Injection vulnerability in diskusage-ng allows an attacker to execute arbitrary commands on the system where the package is installed. By injecting malicious commands into the path argument, an attacker can gain unauthorized access, escalate privileges, or perform other malicious activities. This vulnerability poses a significant risk to the integrity, confidentiality, and availability of the affected system.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can sanitize the path argument by validating and sanitizing user input. This can be achieved by using input validation techniques, such as whitelisting allowed characters or using regular expressions to ensure the path only contains valid characters. Additionally, it is recommended to implement proper input sanitization and validation throughout the application to mitigate the risk of other similar vulnerabilities.

Conclusion

diskusage-ng versions up to 0.2.4 are vulnerable to OS Command Injection, which allows an attacker to execute arbitrary commands on the system. To mitigate this vulnerability, it is crucial to upgrade to a patched version (0.2.5 or higher) and implement proper input sanitization and validation. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for diskusage-ng →

Share this vulnerability

FAQ

diskusage-ng is an npm package that provides disk usage information for a given path. It helps users analyze disk space consumption and retrieve disk usage statistics.

OS Command Injection is a vulnerability that allows an attacker to execute arbitrary commands on a target system by injecting malicious commands into user-controllable input.

This vulnerability allows an attacker to execute arbitrary commands on the system where diskusage-ng is installed. This can lead to unauthorized access, privilege escalation, data loss, or other malicious activities.

To fix this vulnerability, upgrade to a patched version of diskusage-ng (0.2.5 or higher). Update your package.json file and run the package manager command to fetch the latest version.

As a temporary workaround, you can sanitize the path argument by validating and sanitizing user input. Implement proper input sanitization and validation throughout your application to mitigate similar vulnerabilities.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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