CVE-2018-3717: Cross-Site Scripting in connect

connect Updated 02 Oct 2025

Summary

26/07/2018
Yes i
Moderate
5.4

CVE-2018-3717: Cross-Site Scripting in connect. Affects connect versions < 2.14.0. Fixed in 2.14.0. How to fix ↓

Also tracked for

The same CVE-2018-3717 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The connect node module is an npm package that provides middleware for creating web servers in Node.js. It is widely used for building web applications and APIs. The vulnerability in connect version before 2.14.0 allows for a Cross-Site Scripting (XSS) attack due to a lack of validation of files in the directory.js middleware.

Vulnerability Detail

The Cross-Site Scripting (XSS) vulnerability in connect allows an attacker to inject malicious scripts into web pages viewed by users. This can lead to various security issues, such as stealing sensitive information, session hijacking, or performing actions on behalf of the user. The vulnerability arises from the failure to properly validate files in the directory.js middleware, allowing an attacker to upload and execute malicious scripts.

How To Fix

Minimum fixed version

2.14.0

This is the first release that contains the fix.

npm install connect@2.14.0

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 feasible, a temporary workaround is to implement additional input validation and sanitization measures in the affected middleware. This can involve using security libraries or frameworks that provide protection against XSS attacks, such as the 'xss' library. Here is an example of how to use the 'xss' library as a workaround:

const xss = require('xss');

app.use((req, res, next) => {
  req.body = xss(req.body);

next();

});

Conclusion

The Cross-Site Scripting vulnerability in connect version before 2.14.0 can have serious security implications for web applications and APIs. It is crucial to upgrade to the latest version or implement the recommended workaround to mitigate the risk of XSS attacks. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for connect →

Share this vulnerability

FAQ

The vulnerability allows an attacker to inject malicious scripts into web pages, potentially leading to unauthorized access, data theft, or other malicious activities.

While there is no specific known exploit available, the vulnerability can be exploited by an attacker who can upload and execute malicious scripts.

No, only versions before 2.14.0 are affected. It is recommended to upgrade to the latest version to mitigate the vulnerability.

Yes, the CVSS score for this vulnerability is 5.4, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for connect.

How To Fix

Minimum fixed version

2.14.0

This is the first release that contains the fix.

npm install connect@2.14.0

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