Command Injection in expressfs

expressfs Updated 02 Oct 2025

Summary

03/09/2020
HIGH
No i
High
Not published

GHSA-mxmj-84q8-34r7: Command Injection in expressfs. Affected versions are not published. 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

expressfs is an npm package that provides a file system API for the Express.js framework. It allows users to perform various file system operations such as appending files, copying files, creating directories, and removing directories. However, all versions of expressfs are vulnerable to Command Injection, which can lead to arbitrary command execution on the system.

Vulnerability Detail

The vulnerability in expressfs arises from the lack of input validation on several API endpoints. Attackers can exploit this by injecting malicious commands into user input, which are then executed by the system. The affected endpoints are expressfs.appendFile, expressfs.cp, expressfs.create, and expressfs.rmdir. This vulnerability has a high severity rating and is classified under CWE-77 (Improper Neutralization of Special Elements used in a Command). If exploited, it can result in unauthorized access, data loss, or even complete system compromise.

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 there is no fix available, the best workaround is to replace the usage of expressfs with a different module that provides similar functionality but is not affected by this vulnerability. Here's an example of how you can replace the usage of expressfs.appendFile with the fs.appendFile method from the Node.js built-in fs module:

const fs = require('fs');

fs.appendFile('file.txt', 'data to append', (err) => {
  if (err) throw err;
  console.log('The data was appended to the file!');
});

Conclusion

expressfs is vulnerable to Command Injection, which can allow attackers to execute arbitrary commands on the system. It is recommended to replace the usage of expressfs with an alternative module until a fix is released. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for expressfs →

Share this vulnerability

FAQ

expressfs is an npm package that provides a file system API for the Express.js framework.

Command Injection is a vulnerability that allows an attacker to execute arbitrary commands on a system by injecting malicious input.

The affected endpoints in expressfs are expressfs.appendFile, expressfs.cp, expressfs.create, and expressfs.rmdir.

This vulnerability has a high severity rating.

No, there is currently no fix available for this vulnerability.

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