CVE-2018-3771
statics-server Cross-site Scripting vulnerability
Description
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: ```js // ./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>` } }); (...) ```
How to fix CVE-2018-3771
No fixed version has been published yet. Mitigate by removing the affected package or applying upstream guidance from the references below.
- —no fix listed
Is CVE-2018-3771 being exploited?
Low — EPSS is 0.2%, meaning exploitation activity has not been observed at scale.
Affected packages (1)
- from 0, <= 0.0.9
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 3.1 | MEDIUM6.1 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |