Summary
OneUptime versions prior to 10.0.21 contain an unauthenticated path traversal vulnerability in the /workflow/docs/:componentName endpoint that enables arbitrary file reads from the server filesystem.
By manipulating the componentName route parameter, an attacker can traverse directories and access sensitive files that the OneUptime process can read.
Affected context
This vulnerability occurs in the OneUptime web application layer, specifically within the workflow documentation feature exposed at /workflow/docs/:componentName.
The server-side implementation in Worker/FeatureSet/Workflow/Index.ts concatenates the componentName route parameter directly into a filesystem path passed to res.sendFile() without sanitization or normalization checks.
The issue is relevant where the application is reachable over the network and runs with access to sensitive configuration, logs, or source code files on the host.
Exploit preconditions
- Attack surface: Public HTTP(S) interface of the OneUptime application.
- Required access: No authentication or prior session required; exploitable by any network user who can reach the
/workflow/docs/:componentNameroute. - Trigger point: A crafted
componentNamevalue in the URL (e.g., using directory traversal sequences) that manipulates the resulting file path. - Why exploitation is possible: The route parameter is concatenated into a filesystem path and passed directly to
res.sendFile()without path normalization, traversal checks, or access control, allowing escape from the intended documentation directory.
Why this happens
The root cause aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
The server builds a file path by directly appending user-controlled input (:componentName) onto a base directory and then serves that file via res.sendFile().
Without proper canonicalization, validation, or enforcement that the resolved path remains within an allowed directory, attackers can use traversal patterns (e.g., ../) or absolute-like segments to cause the server to read and return unintended files.
This pattern reflects a broader issue of treating path components from external input as trustworthy and not constraining file access to a strict, whitelisted set of resources.
Potential impact
- Access to application configuration files that may contain database credentials, API keys, or encryption secrets.
- Exposure of server-side source code, facilitating further vulnerability discovery and exploitation.
- Disclosure of log files that may include user data, internal endpoint details, or operational metadata.
- Leakage of environment files or system configuration that can support privilege escalation or lateral movement.
- Indirect assistance in planning more severe attacks such as remote code execution via separate weaknesses.
General mitigation guidance
Effective mitigation focuses on strictly constraining file access and removing trust in route parameters for filesystem decisions:
- Replace dynamic path concatenation with a whitelist-based lookup, where
componentNamemaps to predefined, known documentation files rather than arbitrary filenames. - Enforce path normalization and traversal checks: resolve the requested path to its canonical form and verify it resides inside a designated documentation directory before serving.
- Use framework-level helpers or middleware (when available) that restrict
sendFileoperations to specific root directories and reject any paths that break out of that root. - Apply authentication and authorization to documentation endpoints if they expose potentially sensitive internal materials.
- Run the application under a least-privilege account with filesystem permissions limited to what the service strictly needs, reducing the blast radius of any file read.
How teams detect issues like this
Detection generally centers on code patterns and runtime behavior:
- Static analysis: Flag any usage of
res.sendFile(),fs.readFile(), or similar APIs where arguments are derived from user input (including route parameters) without normalization or directory constraints. - Code review: Look for manual string concatenation to form file paths, absence of path validation utilities, and endpoints that serve files based solely on user-controlled segments.
- Security testing: Use dynamic application security testing (DAST) to probe endpoints with
../sequences and monitor whether responses contain unexpected file content or error messages disclosing filesystem paths. - Logging and monitoring: Instrument file-serving routes to log canonical paths being served and raise alerts on attempts to access paths outside the intended documentation directory.

