CVE-2018-3771
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: ```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>` } }); (...) ```
如何修補 CVE-2018-3771
目前尚未發布修補版本。可考慮移除受影響套件,或參考下方連結中的上游建議。
- —未列出修補版本
CVE-2018-3771 正在被利用嗎?
低 — EPSS 為 0.2%,目前沒有觀察到大規模利用活動。
受影響套件(1)
- from 0, <= 0.0.9
CVSS 分數
| 來源 | 版本 | 嚴重程度 | 向量 |
|---|---|---|---|
| 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 |