CVE-2019-5422
Description
Cross-site scripting (XSS) vulnerability in buttle npm package version 0.2.0 allows an attacker to execute arbitrary JavaScript by creating an arbitrary file on the server.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Cross-site scripting (XSS) vulnerability in buttle npm package version 0.2.0 allows an attacker to execute arbitrary JavaScript by creating an arbitrary file on the server.
Vulnerability
The buttle npm package version 0.2.0 is vulnerable to cross-site scripting (XSS) due to missing Content-Type headers when serving static files. An attacker who can create an arbitrary file on the server (e.g., via a write vulnerability or misconfigured upload) can craft an HTML file containing malicious JavaScript. When a victim accesses this file via the buttle server, the browser interprets and executes the script. This issue is documented in the GitHub Advisory [2].
Exploitation
To exploit this vulnerability, the attacker must have the ability to write a file to the server's file system where buttle serves static content. The attacker uploads or creates an HTML file with embedded JavaScript (e.g., `). When a victim visits the corresponding URL, the server serves the file without a restrictive Content-Type` header, causing the browser to render it as HTML and execute the script. No user interaction beyond visiting the URL is required.
Impact
Successful exploitation allows the attacker to execute arbitrary JavaScript in the context of the victim's browser. This can lead to theft of session cookies, credential harvesting, defacement, or redirection to malicious sites. The attack compromises the confidentiality and integrity of the victim's interaction with the web application.
Mitigation
As of the advisory publication (April 2019), no official patch has been released for buttle version 0.2.0. The package appears to be unmaintained. Users are advised to avoid using buttle or replace it with an alternative static file server that properly sets content security headers. If migration is not immediately possible, a reverse proxy can be configured to add Content-Type headers or restrict file serving to non-HTML types.
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
buttlenpm | <= 0.2.0 | — |
Affected products
2- Npm, Inc./buttlev5Range: 0.2.0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
6- github.com/advisories/GHSA-gm29-35c7-8cfwghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2019-5422ghsaADVISORY
- hackerone.com/reports/331032ghsaWEB
- hackerone.com/reports/331110ghsax_refsource_MISCWEB
- www.npmjs.com/advisories/1009ghsaWEB
- www.npmjs.com/advisories/667ghsaWEB
News mentions
0No linked articles in our index yet.