Cross-site Scripting (XSS) Affecting public package, versions <0.1.4


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Mature
EPSS
0.1% (43rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDnpm:public:20180415
  • published17 Apr 2018
  • disclosed15 Apr 2018
  • creditbl4de

Introduced: 15 Apr 2018

CVE-2018-16480  (opens in a new tab)
CVE-2018-3747  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade public to version 0.1.4 or higher.

Overview

public is a package used for running static file hosting server with specified public dir & port. Also it supports a "direcotry index" like Apache httpd.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) attacks. It allows to embed HTML in file names, which (in certain conditions) might lead to execute malicious JavaScript.

Vulnerable Code:

// node_modules/public/bin/public, line 106:
files.forEach(function(file) {
    list.push('<li><a href="', path.join(base, file),'">', file, '</a></li>');
});

Details

CVSS Scores

version 3.1