# CVE-2018-3718: Vercel serve path traversal via URL encoding

Source: https://junglewise.ai/threats/cve-2018-3718-vercel-serve-path-traversal-via-url-encoding  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-08-09. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2018-3718 · Severity: low · CVSS 3.1 · Published 2021-08-09

Vercel's serve module is a Node.js package used to serve static files and list directories from a web server. An attacker can bypass file access restrictions by URL-encoding the filename, allowing access to files that should be restricted from serving. This could expose sensitive files that were meant to be protected.

Technologies: [serve (npm)](https://junglewise.ai/threats/technologies/serve). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2018-3718 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2018-3718 being exploited in the wild.

**How severe is CVE-2018-3718?** Low severity, with a CVSS score of 3.1, published 9 August 2021.

**Which products and versions are affected?** serve (npm) SEMVER:introduced=0,fixed=6.5.2.

**Is there a fix for CVE-2018-3718?** Yes. serve (npm): upgrade to 6.5.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2018-3718 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2018-3718?** 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.5.2 or later

  ```sh
  npm install serve@6.5.2
  ```


## Technical details

The serve module improperly handles URL-encoded filenames, failing to properly decode and validate file access restrictions before serving content. This is a CWE-177 (Improper Handling of URL Encoding) vulnerability where URL-encoded characters bypass the intended blocklist or access control checks. An attacker can send HTTP requests with URL-encoded filenames to access files that should be restricted—for example, encoding dots or slashes to traverse directories or access ignored files. The attack requires network access and no authentication, making it directly exploitable. The vulnerability was patched in version 6.5.2; users should upgrade from affected versions (all versions prior to 6.5.2).

## Affected products

- Vercel serve before 6.5.2

## Identifiers

- CVE-2018-3718
- GHSA-5rc4-8qqh-vq7f

## Timeline

- 2018-06-07: disclosed: NVD published
- 2021-08-09: advisory: GHSA advisory published
- 2021-08-09: patched: Fixed in version 6.5.2

## References

- [https://hackerone.com/reports/308721](https://hackerone.com/reports/308721)
- [https://github.com/vercel/serve](https://github.com/vercel/serve)

## Related threats

- [serve Cross-Site Scripting in filename handling](https://junglewise.ai/threats/serve-cross-site-scripting-in-filename-handling-f9ba227e)
- [serve cross-site scripting in directory listing](https://junglewise.ai/threats/serve-cross-site-scripting-in-directory-listing-bd56c0df)
- [serve Path Traversal via explicitly ignored folders](https://junglewise.ai/threats/serve-path-traversal-via-explicitly-ignored-folders-70a1a073)
- [serve path validation bypass via URL encoding](https://junglewise.ai/threats/serve-path-validation-bypass-via-url-encoding-c91ec671)
- [serve directory traversal](https://junglewise.ai/threats/cve-2019-5417-serve-directory-traversal)
