CVE-2018-3717: Connect Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-rch9-xh7r-mqgw
CVSS 5.4
CWE-79
Published
Advisory Summary

CVE-2018-3717 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Connect libraries in the npm ecosystem. The issue involves cross-site scripting in connect. Remediation is available by upgrading affected packages to version 2.14.0.

CVE-2018-3717 at a Glance

CVE Identifier CVE-2018-3717
GHSA Identifier GHSA-rch9-xh7r-mqgw
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Connect
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2018-3717

To remediate this vulnerability, upgrade all affected Connect dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

connect fixed: 2.14.0
npm install connect@2.14.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls connect

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2018-3717, inspect your project dependencies using npm:

npm ls connect

Analyze the terminal output to locate any version of Connect in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.14.0), your application is affected.

Note: The npm ls connect command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Connect, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

connect node module before 2.14.0 suffers from a Cross-Site Scripting (XSS) vulnerability due to a lack of validation of file in directory.js middleware.

CVE-2018-3717 Affected Connect Versions

1 component(s)
Fixed Versions:
2.14.0
Product / Package Ecosystem Affected Versions Fixed Version
connect
npm
< 2.14.0
2.14.0

References

Frequently Asked Questions

What is CVE-2018-3717?
CVE-2018-3717 is a security vulnerability in Connect involving Cross-Site Scripting in connect under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Connect versions are affected?
Affected versions include releases prior to 2.14.0 across affected packages: connect.
What version fixes CVE-2018-3717?
Upgrading to 2.14.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is connect affected?
Yes, connect is affected in releases prior to 2.14.0. Upgrade your dependency to 2.14.0 or later.
What is the CVSS score of CVE-2018-3717?
CVE-2018-3717 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2018-3717?
CVE-2018-3717 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2018-3717?
Run the dependency tree command: 'npm ls connect'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rch9-xh7r-mqgw",
  "modified" : "2023-05-30T19:26:12Z",
  "published" : "2018-07-26T15:08:05Z",
  "aliases" : [ "CVE-2018-3717" ],
  "summary" : "Cross-Site Scripting in connect",
  "details" : "connect node module before 2.14.0 suffers from a Cross-Site Scripting (XSS) vulnerability due to a lack of validation of file in directory.js middleware.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "connect"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.14.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-3717"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JacksonTian/anywhere/issues/33#issuecomment-366527448"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/senchalabs/connect/commit/6d5dd30075d2bc4ee97afdbbe3d9d98d8d52d74b"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/309394"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/309641"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-rch9-xh7r-mqgw"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/584"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/595"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:54:23Z",
    "nvd_published_at" : "2018-06-07T02:29:00Z"
  }
}