GHSA-393X-FR59-R8FG
Vulnerability from github – Published: 2022-05-13 01:32 – Updated: 2024-04-22 23:08
VLAI?
Summary
statics-server Cross-site Scripting vulnerability
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:
// ./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>`
}
});
(...)
Severity ?
6.1 (Medium)
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "statics-server"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.0.9"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2018-3771"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2024-04-22T23:08:32Z",
"nvd_published_at": "2018-07-20T22:29:00Z",
"severity": "MODERATE"
},
"details": "An XSS in statics-server \u003c= 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 `\u003ca href\u003e` element without escaping, which allows to embed HTML `\u003ciframe\u003e` tag with `src` attribute points to another HTML file in the directory. This file can contain malicious JavaScript code, which will be executed:\n\n```js\n// ./node_modules/statics-server/index.js, line 18:\n\n if(fs.lstatSync(staticPath).isDirectory()){\n var files=fs.readdirSync(staticPath);\n var lis=\u0027\u0027;\n files.forEach((v,i)=\u003e{\n if(fs.lstatSync(path.resolve(staticPath,v)).isDirectory()){\n lis+=`\u003cli\u003e\u003ca href=\"${req.url}${v}/\"\u003e${v}/\u003c/a\u003e\u003c/li\u003e`;\n }else {\n lis+=`\u003cli\u003e\u003ca href=\"${req.url}${v}\"\u003e${v}\u003c/a\u003e\u003c/li\u003e`\n }\n });\n\n (...)\n```",
"id": "GHSA-393x-fr59-r8fg",
"modified": "2024-04-22T23:08:32Z",
"published": "2022-05-13T01:32:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-3771"
},
{
"type": "WEB",
"url": "https://hackerone.com/reports/355458"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "statics-server Cross-site Scripting vulnerability"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…