Summary
CVE-2021-48011 is a path traversal vulnerability (CWE-22) in Servor, the lukejacksonn/servor Node.js static file server, affecting versions 1.0.0 through 4.0.2. An unauthenticated remote attacker can use URL-encoded dot segments to escape the served root directory and read files or list directories outside it. The CVE is rated High, with a CVSS v4.0 score of 8.7.
Technical details
- Root cause: Servor calls
decodeURI()on the request path, which turns%2e%2e/sequences into../, and only then callspath.join(). This happens in both theserveStaticFileandserveDirectoryListingfunctions, so the decoded dot segments are never constrained to the served root. - Trigger conditions: The attacker sends an HTTP request containing URL-encoded dot segments. Browsers normally resolve literal
../before sending a request, but command-line clients such as curl can send the sequences unmodified (per the upstream pull request discussion). - Attack vector: Network. No authentication or user interaction is required.
- Impact: Arbitrary file reads and directory listings outside the intended root directory, which can expose sensitive files on the host. The CVSS vectors indicate high confidentiality impact and no integrity or availability impact.
Affected software
- Servor (npm package
servor, lukejacksonn) versions 1.0.0 through 4.0.2
Severity
- CVSS v4.0: 8.7 (High),
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N - CVSS v3.1: 7.5 (High),
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Mitigation and recommended actions
- Immediate: Upgrade Servor to a release that includes the fix from upstream pull request #70 (patch commit ec7d824), which was merged on June 30, 2021. The advisories reviewed do not name a specific fixed version number, so check the Servor releases page to confirm that the version you install is later than 4.0.2 and contains the commit.
- If no patch can be applied: The advisories do not document an official workaround. As general hardening, do not expose Servor directly to untrusted networks, and keep sensitive files out of the parent directories of the served root. Use a reverse proxy that rejects requests containing encoded dot segments (
%2e%2e). - Servor is typically used as a development server. Identify any instances reachable from the internet and take them offline or restrict access.

