Cross-Site Scripting (XSS) Vulnerability in node-serve-index

node-serve-index Updated 02 Oct 2025

Summary

23/01/2017
N/A
Yes i
Medium
6.1

CVE-2015-8856: Cross-site scripting (XSS) vulnerability in the serve-index package before 1.6.3 for Node.js allows remote attackers to inject arbitrary web script or HTML via a crafted file or directory name. Affects node-serve-index versions < 1.9.1-1. Fixed in 1.9.1-1. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

node-serve-index is a package for Node.js that provides a middleware for serving directory listings. It allows users to browse the contents of a directory on a web server. This package is commonly used in web applications to display file and directory listings to users. However, a vulnerability has been discovered in versions before 1.6.3 that allows remote attackers to inject arbitrary web script or HTML through a crafted file or directory name.

Vulnerability Detail

The vulnerability, identified as CVE-2015-8856, is a Cross-Site Scripting (XSS) vulnerability. It occurs when user-supplied input is not properly sanitized and is rendered on a web page without proper encoding. In the case of node-serve-index, this vulnerability allows an attacker to inject malicious script or HTML code into the directory listing page, which can then be executed by unsuspecting users who view the page. This can lead to various attacks, such as stealing sensitive information, session hijacking, or spreading malware.

How To Fix

Minimum fixed version

1.9.1-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-serve-index

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the package is not immediately possible, a temporary workaround is to disable directory listing or implement additional input validation and sanitization measures in the application code. This can help mitigate the risk of XSS attacks until the package is updated.

Conclusion

In conclusion, the node-serve-index package before version 1.6.3 is vulnerable to a Cross-Site Scripting (XSS) attack. It is crucial to update the package to the latest version or apply temporary measures to mitigate the risk. For further assistance and support in vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for node-serve-index →

Share this vulnerability

FAQ

Cross-Site Scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts or HTML code into web pages viewed by other users. It occurs when user-supplied input is not properly sanitized and is rendered on a web page without proper encoding.

If your application uses the node-serve-index package and is vulnerable to this XSS vulnerability, an attacker can inject malicious scripts or HTML code into the directory listing page. This can lead to various attacks, such as stealing sensitive information, session hijacking, or spreading malware.

Yes, a fix is available in version 1.6.3 of the node-serve-index package. It is recommended to update to this version or later to mitigate the XSS vulnerability.

If updating the package is not immediately possible, you can disable directory listing or implement additional input validation and sanitization measures in your application code. This can help mitigate the risk of XSS attacks until the package is updated.

You can find more information about this vulnerability, including the CVE identifier (CVE-2015-8856), in the National Vulnerability Database (NVD) or the vulnerability database provided by Vulert.

Related vulnerabilities

Recent vulnerabilities recorded for node-serve-index.

How To Fix

Minimum fixed version

1.9.1-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-serve-index

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