Command Injection in fs-path

fs-path Updated 02 Oct 2025

Summary

12/06/2019
HIGH
Yes i
High
Not published

GHSA-gc94-6w89-hpqr: Command Injection in fs-path. Affects fs-path versions < 0.0.25. Fixed in 0.0.25. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The fs-path package is an npm module that provides utility functions for working with file system paths. It is commonly used in Node.js applications to manipulate and manage file paths. However, all versions of fs-path are vulnerable to command injection if unsanitized user input is passed in. This means that an attacker can potentially execute arbitrary commands on the system where the vulnerable code is running.

Vulnerability Detail

The vulnerability in fs-path arises from the lack of proper input sanitization. When user input is not properly validated or sanitized before being used in a command, it can lead to command injection attacks. In this case, an attacker can craft malicious input that includes shell commands, which are then executed by the vulnerable code. This can result in unauthorized access, data leakage, or even complete compromise of the system.

How To Fix

Minimum fixed version

0.0.25

This is the first release that contains the fix.

npm install fs-path@0.0.25

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

Workaround

As there is no fix available, it is important to be cautious when using fs-path. Ensure that any user input passed to fs-path functions is properly validated and sanitized to prevent command injection. Implement strict input validation and consider using a secure alternative package if possible.

Conclusion

The fs-path package is vulnerable to command injection if unsanitized user input is passed in. This can lead to serious security risks and compromise of the system. It is recommended to avoid using fs-path until a fix is provided. Implement strict input validation and consider using alternative packages that have been audited for security vulnerabilities. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for fs-path →

Share this vulnerability

FAQ

Command injection is a security vulnerability that allows an attacker to execute arbitrary commands on a system by injecting malicious input into a command execution function.

Command injection can lead to unauthorized access, data leakage, or complete compromise of the system. Attackers can execute arbitrary commands with the privileges of the vulnerable application, potentially gaining control over the entire system.

To protect your application from command injection, always validate and sanitize user input before using it in command execution functions. Use parameterized queries or prepared statements to prevent command injection in database queries. Additionally, consider using security-focused libraries or frameworks that provide built-in protection against command injection.

No, there is currently no fix available for this vulnerability in fs-path. It is recommended to avoid using this package until a fix is provided by the package maintainer.

Yes, there are alternative packages available that have been audited for security vulnerabilities and are not vulnerable to command injection. Consider using those packages instead of fs-path until a fix is available.

Related vulnerabilities

Recent vulnerabilities recorded for fs-path.

How To Fix

Minimum fixed version

0.0.25

This is the first release that contains the fix.

npm install fs-path@0.0.25

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