CVE-2018-3771: statics-server XSS in directory index listing

CVE-2018-3771 · Severity: low · CVSS 3 · Published 2022-05-13

The statics-server package, a tool used to serve static files and display directory listings, is vulnerable to a security flaw that allows attackers to execute malicious scripts in a user's browser. By placing a file with a specially crafted name in a directory served by the tool, an attacker can trigger a cross-site scripting (XSS) attack when a user views the directory index. This could lead to unauthorized actions being performed on behalf of the user or the theft of sensitive session information.

Technologies: statics-server (npm). Vendors: npm.

Quick answers

Is CVE-2018-3771 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2018-3771 being exploited in the wild.
How severe is CVE-2018-3771?
Low severity, with a CVSS score of 3, published 13 May 2022.
Which products and versions are affected?
statics-server (npm) SEMVER:introduced=0,last_affected=0.0.9.
Is there a fix for CVE-2018-3771?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2018-3771 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2018-3771?
Check whether you run statics-server (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A cross-site scripting (XSS) vulnerability exists in statics-server versions 0.0.9 and earlier. The vulnerability is located in the directory indexing logic within `index.js`, where filenames are retrieved via `fs.readdirSync` and concatenated into HTML `<a>` tags without proper escaping or neutralization. An attacker can exploit this by creating a file with a name containing HTML tags, such as an `<iframe>` or `<script>`. When a victim navigates to the directory listing, the malicious payload is rendered and executed in the context of the victim's browser session. This is classified as CWE-79.

Affected products

  • statics-server project statics-server <= 0.0.9

Identifiers

  • CVE-2018-3771
  • GHSA-393x-fr59-r8fg

Timeline

  • 2018-07-20: advisory: NVD published CVE-2018-3771
  • 2022-05-13: disclosed: GitHub Advisory published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.