Summary
Servor versions 1.0.0 through 4.0.2 contain a path traversal vulnerability in static file and directory-listing handlers. An unauthenticated remote attacker may escape the configured serving root by submitting URL-encoded traversal segments, potentially reading arbitrary files or listing directories when the vulnerable endpoints are exposed.
Servor versions 1.0.0 through 4.0.2 contain a path traversal vulnerability in static file and directory-listing handlers. An unauthenticated remote attacker may escape the configured serving root by submitting URL-encoded traversal segments, potentially reading arbitrary files or listing directories when the vulnerable endpoints are exposed.
Affected context
The vulnerability occurs in Servor deployments that expose static-file serving or directory-listing functionality and process URL paths through decoding before constructing filesystem paths. Risk is higher when the service runs with access to sensitive files outside its intended document root and when those endpoints are reachable without authentication.
The vulnerability occurs in Servor deployments that expose static-file serving or directory-listing functionality and process URL paths through decoding before constructing filesystem paths. Risk is higher when the service runs with access to sensitive files outside its intended document root and when those endpoints are reachable without authentication.
Exploit preconditions
- Attack surface: HTTP static-file and directory-listing endpoints
- Required access: Network connectivity to an exposed Servor instance; authentication is generally not required
- Trigger point: URL path processing in
serveStaticFileorserveDirectoryListing - Why exploitation is possible: URL decoding converts encoded dot segments into traversal components before path construction, allowing the resulting path to resolve outside the configured serving root
- Attack surface: HTTP static-file and directory-listing endpoints
- Required access: Network connectivity to an exposed Servor instance; authentication is generally not required
- Trigger point: URL path processing in
serveStaticFileorserveDirectoryListing - Why exploitation is possible: URL decoding converts encoded dot segments into traversal components before path construction, allowing the resulting path to resolve outside the configured serving root
Why this happens
The underlying bug is improper neutralization of path elements used to construct filesystem paths. Servor decodes attacker-controlled URL input before passing it to path-joining logic, without reliably enforcing that the normalized result remains within the intended root directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.
The underlying bug is improper neutralization of path elements used to construct filesystem paths. Servor decodes attacker-controlled URL input before passing it to path-joining logic, without reliably enforcing that the normalized result remains within the intended root directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.
Potential impact
- An attacker may read sensitive files accessible to the service process.
- An attacker could enumerate directories outside the configured serving root.
- Exposed configuration files, credentials, or source code may be disclosed.
- The vulnerability may support follow-on compromise if retrieved files contain secrets or operational details.
- An attacker may read sensitive files accessible to the service process.
- An attacker could enumerate directories outside the configured serving root.
- Exposed configuration files, credentials, or source code may be disclosed.
- The vulnerability may support follow-on compromise if retrieved files contain secrets or operational details.
General mitigation guidance
Mitigation generally focuses on enforcing the serving-root boundary after complete URL decoding and path normalization.
Common defensive patterns include:
- Resolve requested paths against a fixed document root and verify that the final canonical path remains within that root.
- Reject traversal components and ambiguous encoded separators using consistent, centralized path validation.
- Prefer framework or filesystem APIs designed for confined file serving rather than assembling paths manually.
- Disable directory listing when it is not required.
- Run the service with least-privilege filesystem access and prevent access to sensitive directories.
- Treat URL paths as untrusted input regardless of whether the request reaches an authenticated route.
Mitigation generally focuses on enforcing the serving-root boundary after complete URL decoding and path normalization.
Common defensive patterns include:
- Resolve requested paths against a fixed document root and verify that the final canonical path remains within that root.
- Reject traversal components and ambiguous encoded separators using consistent, centralized path validation.
- Prefer framework or filesystem APIs designed for confined file serving rather than assembling paths manually.
- Disable directory listing when it is not required.
- Run the service with least-privilege filesystem access and prevent access to sensitive directories.
- Treat URL paths as untrusted input regardless of whether the request reaches an authenticated route.
How teams detect issues like this
Organizations commonly detect path traversal risks through:
- Static analysis for URL decoding followed by filesystem path joins or file access.
- Code review checks for missing canonicalization and root-containment validation.
- Dynamic testing with encoded and normalized traversal variants against file-serving endpoints.
- Web application firewall or gateway policies that identify traversal patterns, while recognizing that filtering should not replace server-side validation.
- Monitoring for requests that attempt to access paths outside the expected document root and for unusual directory-enumeration activity.
Organizations commonly detect path traversal risks through:
- Static analysis for URL decoding followed by filesystem path joins or file access.
- Code review checks for missing canonicalization and root-containment validation.
- Dynamic testing with encoded and normalized traversal variants against file-serving endpoints.
- Web application firewall or gateway policies that identify traversal patterns, while recognizing that filtering should not replace server-side validation.
- Monitoring for requests that attempt to access paths outside the expected document root and for unusual directory-enumeration activity.

