CVE-2018-3712: Vercel serve directory traversal

CVE-2018-3712 · Severity: low · CVSS 3 · Published 2018-07-27

Serve is a popular Node.js package for serving static files over HTTP. A directory traversal vulnerability allows attackers to list the contents of any directory accessible to the process, bypassing intended restrictions on what files can be accessed. While this does not permit reading arbitrary file contents, it can expose sensitive directory structures and aid reconnaissance for further attacks.

Technologies: serve (npm). Vendors: npm.

Quick answers

Is CVE-2018-3712 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2018-3712 being exploited in the wild.
How severe is CVE-2018-3712?
Low severity, with a CVSS score of 3, published 27 July 2018.
Which products and versions are affected?
serve (npm) SEMVER:introduced=0,fixed=6.4.9.
Is there a fix for CVE-2018-3712?
Yes. serve (npm): upgrade to 6.4.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2018-3712 attacked?
It is attacked over the network.
Am I affected by CVE-2018-3712?
Check whether you run serve (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • serve (npm): upgrade to 6.4.9 or later
    npm install serve@6.4.9

Technical details

The vulnerability exists in serve versions prior to 6.4.9 and stems from improper handling of percent-encoded path separators (%2e representing "." and %2f representing "/"). Attackers can craft URLs containing these encoded characters to traverse the directory tree and enumerate directory contents, bypassing path normalization. The attack is network-reachable and requires no authentication. While directory listing is exposed, arbitrary file read is not possible. The fix was merged in PR #316 and released in version 6.4.9, which properly normalizes and scopes paths to the working directory.

Affected products

  • Vercel serve prior to 6.4.9

Identifiers

  • CVE-2018-3712
  • GHSA-q2qh-cgc2-qhr3

Timeline

  • 2018-07-27: disclosed
  • 2018-01-23: patched: Fix merged in PR #316

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.