CVE-2018-3758: express-cart unrestricted file upload vulnerability

express-cart Updated 02 Oct 2025

Summary

13/05/2022
Yes i
High
8.8

CVE-2018-3758: express-cart unrestricted file upload vulnerability. Affects express-cart versions < 1.1.7. Fixed in 1.1.7. 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

express-cart is an npm package that provides a shopping cart functionality for Express.js applications. It allows users to manage products, add them to a cart, and perform various e-commerce operations. However, a vulnerability has been discovered in versions prior to 1.1.7 that allows a privileged user to upload files without proper validation, leading to remote code execution (RCE) on the hosting machine.

Vulnerability Detail

The unrestricted file upload vulnerability in express-cart allows a privileged user to upload malicious files to the server. This can lead to various security risks, including remote code execution, unauthorized access to sensitive data, and potential compromise of the hosting machine. The vulnerability arises from a lack of proper file type validation and sanitization, allowing attackers to upload executable files or files with malicious content.

How To Fix

Minimum fixed version

1.1.7

This is the first release that contains the fix.

npm install express-cart@1.1.7

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 feasible, a temporary workaround is to disable file uploads or implement strict file type validation and sanitization. This can be done by modifying the code that handles file uploads and ensuring that only allowed file types are accepted. Here's an example of how to validate file types using the 'mime' package:

const mime = require('mime');

function validateFileType(file) {
  const allowedTypes = ['image/jpeg', 'image/png'];
  const fileType = mime.getType(file.path);
  if (!allowedTypes.includes(fileType)) {
    throw new Error('Invalid file type');
  }
}

Conclusion

The express-cart module prior to version 1.1.7 is vulnerable to an unrestricted file upload vulnerability, which can lead to remote code execution. It is crucial to upgrade to version 1.1.7 or later to fix this vulnerability. If immediate upgrade is not possible, implement strict file type validation and sanitization as a temporary workaround. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for express-cart →

Share this vulnerability

FAQ

The vulnerability allows a privileged user to upload malicious files, potentially leading to remote code execution and unauthorized access to sensitive data on the hosting machine.

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 known vulnerabilities.

Yes, the CVSS score for this vulnerability is 8.8, indicating a high severity level.

While specific exploits for this vulnerability may not be publicly available, the unrestricted file upload vulnerability is a well-known issue that can be exploited by attackers to execute arbitrary code.

Yes, the vulnerability has been fixed in version 1.1.7 of the express-cart module. It is recommended to upgrade to this version or later to mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for express-cart.

How To Fix

Minimum fixed version

1.1.7

This is the first release that contains the fix.

npm install express-cart@1.1.7

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