Cross-Site Scripting (XSS) Vulnerability in serve

serve Updated 02 Oct 2025

Summary

11/09/2020
MODERATE
Yes i
Moderate
Not published

GHSA-cpgr-wmr9-qxv4: Cross-Site Scripting in serve. Affects serve versions < 10.0.2. Fixed in 10.0.2. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Serve is an npm package that allows developers to quickly create static file servers for local development or production environments. It is commonly used to serve static websites or files. However, versions prior to 10.0.2 are vulnerable to Cross-Site Scripting (XSS) attacks. This means that 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 serve arises from the package's failure to sanitize filenames. This allows attackers to inject and execute arbitrary JavaScript code in the victim's browser. By crafting filenames with malicious code, an attacker can trick users into unknowingly executing the code when accessing the files served by the vulnerable package. This can lead to various security risks, such as unauthorized access to sensitive information, session hijacking, or the spread of malware.

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 serve versions prior to 10.0.2 can lead to the execution of arbitrary JavaScript code in the victim's browser. To mitigate this risk, it is crucial to upgrade to version 10.0.2 or later. Developers should promptly update their package dependencies and ensure they are using the latest secure version of serve. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for serve →

Share this vulnerability

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 unauthorized access, data theft, or the spread of malware.

This vulnerability affects serve users by allowing attackers to execute arbitrary JavaScript code in the victim's browser. This can lead to various security risks, such as unauthorized access to sensitive information or the spread of malware.

No, only versions prior to 10.0.2 are vulnerable to this Cross-Site Scripting (XSS) issue. It is important to update to version 10.0.2 or later to mitigate the risk.

No, there is no known workaround for this vulnerability. It is recommended to upgrade to the latest secure version of serve to fix the issue.

Related vulnerabilities

Recent vulnerabilities recorded for serve.

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 →

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