Vulnerabilities in pkg:npm/serve-handler

PACKAGE
Advisory Summary

GHSA-9vhv-p9r7-rm53 is a MODERATE html tag injection vulnerability (General Security Weakness) affecting Serve handler libraries in the npm ecosystem. The issue involves html tag injection. Remediation is available by upgrading affected packages to version 5.0.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/serve-handler

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/serve-handler. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9vhv-p9r7-rm53 - MODERATE HTML tag injection

GHSA-9vhv-p9r7-rm53 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-9vhv-p9r7-rm53
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Serve handler
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-9vhv-p9r7-rm53

To remediate this vulnerability, upgrade all affected Serve handler dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

serve-handler fixed: 5.0.3
npm install serve-handler@5.0.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls serve-handler

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-9vhv-p9r7-rm53, inspect your project dependencies using npm:

npm ls serve-handler

Analyze the terminal output to locate any version of Serve handler in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.3), your application is affected.

Note: The npm ls serve-handler command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Serve handler, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Serve Handler, before 5.0.3, has a XSS via HTML tag injection in directory lisiting page.

GHSA-9vhv-p9r7-rm53 Affected Serve handler Versions

1 component(s)
Fixed Versions:
5.0.3
Product / Package Ecosystem Affected Versions Fixed Version
serve-handler
npm
< 5.0.3
5.0.3

References

Frequently Asked Questions

What is GHSA-9vhv-p9r7-rm53?
GHSA-9vhv-p9r7-rm53 is a security vulnerability in Serve handler involving HTML tag injection under General Security Weakness.
Which Serve handler versions are affected?
Affected versions include releases prior to 5.0.3 across affected packages: serve-handler.
What version fixes GHSA-9vhv-p9r7-rm53?
Upgrading to 5.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is serve-handler affected?
Yes, serve-handler is affected in releases prior to 5.0.3. Upgrade your dependency to 5.0.3 or later.
What CWE is associated with GHSA-9vhv-p9r7-rm53?
GHSA-9vhv-p9r7-rm53 is classified under General Security Weakness.
How can I check npm dependencies for GHSA-9vhv-p9r7-rm53?
Run the dependency tree command: 'npm ls serve-handler'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9vhv-p9r7-rm53",
  "modified" : "2021-02-23T21:37:48Z",
  "published" : "2021-02-23T21:37:48Z",
  "withdrawn" : "2021-02-23T21:37:48Z",
  "aliases" : [ ],
  "summary" : "HTML tag injection",
  "details" : "Serve Handler, before 5.0.3, has a XSS via HTML tag injection in directory lisiting page.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "serve-handler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zeit/serve-handler/commit/65b4d4183a31a8076c78c40118acb0ca1b64f620"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/398285"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-06T08:49:37Z",
    "nvd_published_at" : null
  }
}