Loading HuntDB...

GHSA-393x-fr59-r8fg

GitHub Security Advisory

statics-server Cross-site Scripting vulnerability

✓ GitHub Reviewed MODERATE Has CVE

Advisory Details

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>`
}
});

(...)
```

Affected Packages

npm statics-server
Affected versions: 0 (last affected: 0.0.9)

Related CVEs

Key Information

GHSA ID
GHSA-393x-fr59-r8fg
Published
May 13, 2022 1:32 AM
Last Modified
April 22, 2024 11:08 PM
CVSS Score
5.0 /10
Primary Ecosystem
npm
Primary Package
statics-server
GitHub Reviewed
✓ Yes

Dataset

Last updated: July 2, 2025 6:26 AM

Data from GitHub Advisory Database. This information is provided for research and educational purposes.