Cross-Site Scripting (XSS) Vulnerability in serve
Summary
GHSA-xw79-hhv6-578c: Cross-Site Scripting in serve. Affects serve versions < 10.0.2. Fixed in 10.0.2. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
Serve is an npm package that allows developers to quickly create static file servers for local development or production deployment. It is commonly used to serve static websites or single-page applications. Serve is vulnerable to Cross-Site Scripting (XSS) attacks in versions prior to 10.0.2.
Vulnerability Detail
The vulnerability in serve arises from the package's failure to encode output, which enables attackers to execute arbitrary JavaScript in the victim's browser if user-supplied input is rendered. This can lead to various security risks, including the theft of sensitive information, session hijacking, or the injection of malicious content.
How To Fix
Latest published version: 14.2.6 as of 23 Oct 2026
npm install serve@14.2.6
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
10.0.2
This is the first release that contains the fix.
npm install serve@10.0.2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Conclusion
The Cross-Site Scripting (XSS) vulnerability in the serve package prior to version 10.0.2 poses a significant security risk. It is crucial for developers to upgrade to the latest version to ensure the proper encoding of output and prevent the execution of arbitrary JavaScript in users' browsers. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for serve →
FAQ
Cross-Site Scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. This can lead to the execution of arbitrary code in the victim's browser, compromising their data and potentially enabling further attacks.
The serve package becomes vulnerable to XSS attacks because it fails to properly encode user-supplied input before rendering it. This allows attackers to inject malicious JavaScript code that is executed in the victim's browser.
XSS attacks can have various consequences, including the theft of sensitive information (such as login credentials or personal data), session hijacking, defacement of websites, or the injection of malicious content that can further compromise users or systems.
No, only versions prior to 10.0.2 of the serve package are affected by this XSS vulnerability. It is crucial to update to version 10.0.2 or later to mitigate the risk.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using just the package-lock.json file, without requiring access to the code or installation.
Related vulnerabilities
Recent vulnerabilities recorded for serve.