CVE-2019-5458: Cross-Site Scripting in http-file-server

http-file-server Updated 02 Oct 2025

Summary

31/07/2019
No i
Moderate
5.4

CVE-2019-5458: Cross-Site Scripting in http-file-server. Affects http-file-server versions < 0.2.6. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The http-file-server package is an npm package that provides a simple HTTP server for serving static files. It allows users to easily share files over HTTP. However, all versions of http-file-server are vulnerable to Cross-Site Scripting (XSS) attacks. This vulnerability occurs because the package fails to properly sanitize filenames, allowing attackers to execute arbitrary JavaScript code in the victim's browser through files with malicious names.

Vulnerability Detail

The Cross-Site Scripting (XSS) vulnerability in http-file-server allows attackers to inject and execute arbitrary JavaScript code in the victim's browser. By uploading files with malicious names, an attacker can exploit this vulnerability to perform various malicious actions, such as stealing sensitive information, hijacking user sessions, or defacing websites. The vulnerability has a CVSS score of 5.4, indicating a moderate severity level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As there is no fix available, a possible workaround is to manually sanitize filenames before uploading them to the server. This can be done by implementing a server-side validation mechanism that checks for any potentially malicious characters or patterns in the filenames. Additionally, implementing content security policies (CSP) on the server-side can help mitigate the impact of XSS attacks.

Conclusion

The http-file-server package is vulnerable to Cross-Site Scripting (XSS) attacks due to a lack of filename sanitization. Currently, there is no fix available, and it is recommended to consider using an alternative package. Stay updated with the official repository or package manager for any future patches or updates. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for http-file-server →

Share this vulnerability

FAQ

Cross-Site Scripting (XSS) is a type of security vulnerability that allows attackers to inject and execute malicious scripts in web pages viewed by other users. It occurs when a web application does not properly validate or sanitize user input, allowing the injection of malicious code.

This vulnerability can be exploited by uploading files with malicious names that contain JavaScript code. When a victim accesses the server and opens the file, the malicious code is executed in their browser, allowing the attacker to perform various malicious actions.

The consequences of this vulnerability can be severe. An attacker can use it to steal sensitive information, such as login credentials or personal data, hijack user sessions, deface websites, or perform other malicious actions that the victim's browser is capable of.

Currently, there is no fix available for this vulnerability in the http-file-server package. It is recommended to consider using an alternative package until a fix is made available. Keep an eye on the official repository or package manager for any updates or patches that address this vulnerability.

To mitigate the impact of this vulnerability, you can implement server-side validation mechanisms to sanitize filenames before uploading them. Additionally, implementing content security policies (CSP) can help prevent the execution of malicious scripts in the browser.

Related vulnerabilities

Recent vulnerabilities recorded for http-file-server.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback