Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS0zOTN4LWZyNTktcjhmZ84AARAN
statics-server Cross-site Scripting vulnerability
An XSS in statics-server <= 0.0.9 can be used via injected iframe in the filename when statics-server displays directory index in the browser. Statics-server does not implement any HTML escaping when displays directory index in the browser. Variable v
is used in <a href>
element without escaping, which allows to embed HTML <iframe>
tag with src
attribute points to another HTML file in the directory. This file can contain malicious JavaScript code, which will be executed:
// ./node_modules/statics-server/index.js, line 18:
if(fs.lstatSync(staticPath).isDirectory()){
var files=fs.readdirSync(staticPath);
var lis='';
files.forEach((v,i)=>{
if(fs.lstatSync(path.resolve(staticPath,v)).isDirectory()){
lis+=`<li><a href="${req.url}${v}/">${v}/</a></li>`;
}else {
lis+=`<li><a href="${req.url}${v}">${v}</a></li>`
}
});
(...)
Permalink: https://github.com/advisories/GHSA-393x-fr59-r8fgJSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0zOTN4LWZyNTktcjhmZ84AARAN
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: over 2 years ago
Updated: 9 months ago
CVSS Score: 6.1
CVSS vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS Percentage: 0.00128
EPSS Percentile: 0.48094
Identifiers: GHSA-393x-fr59-r8fg, CVE-2018-3771
References:
- https://nvd.nist.gov/vuln/detail/CVE-2018-3771
- https://hackerone.com/reports/355458
- https://github.com/advisories/GHSA-393x-fr59-r8fg
Affected Packages
npm:statics-server
Dependent packages: 0Dependent repositories: 1
Downloads: 28 last month
Affected Version Ranges: <= 0.0.9
No known fixed version
All affected versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9