Summary
OliveTin's saveLogs feature constructs log file paths using a user-supplied UniqueTrackingId without validation, enabling directory traversal sequences to influence where logs are written.
When exploited via the StartAction API, an attacker can traverse directories and cause OliveTin to write log files to unintended, potentially sensitive locations on the filesystem.
Affected context
This vulnerability appears in OliveTin deployments that:
- Have the saveLogs feature enabled to persist execution logs to disk
- Expose the StartAction API endpoint to users or integrated systems
- Construct log filenames using the UniqueTrackingId field directly in the filesystem path
The risk is elevated when the OliveTin process has permission to write into directories outside the intended log directory, such as configuration paths, web roots, or other application data locations.
Exploit preconditions
- Attack surface: HTTP(S) interface exposing the StartAction API.
- Required access: Ability to send StartAction requests with a controlled UniqueTrackingId value; this may be authenticated or unauthenticated depending on the OliveTin deployment configuration.
- Trigger point: Submission of a StartAction request while saveLogs is enabled, causing OliveTin to create a log file using the supplied UniqueTrackingId in the filename.
- Why exploitation is possible: The application concatenates the UniqueTrackingId directly into a file path without normalization, validation, or restriction to a bounded directory. As a result, directory traversal sequences (e.g.,
../../../) are interpreted by the operating system, allowing writes outside the intended log directory.
Why this happens
The core issue is a path traversal flaw where user-controlled input is used as part of a filesystem path without proper sanitization or enforcement of a safe base directory. This maps directly to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
Instead of treating the UniqueTrackingId as untrusted data and constraining it to safe, normalized filenames, the application builds log file paths by concatenating this value into the path string. Filesystem calls then interpret traversal sequences and other metacharacters, allowing the write operation to escape the designated logs directory and target arbitrary writable locations.
Potential impact
- Creation or overwrite of arbitrary files in directories writable by the OliveTin process.
- Potential corruption of existing application or system configuration files, leading to denial of service or unexpected behavior.
- Placement of attacker-controlled files in locations that may later be interpreted or executed by other components (e.g., scripts, configuration, or content served by a web server), depending on environment.
- Facilitation of further attacks by planting log artifacts that mimic legitimate data or by abusing log contents in downstream processing pipelines.
General mitigation guidance
Effective mitigation focuses on strictly constraining file paths derived from user input and treating identifiers as data, not paths:
- Enforce a fixed, canonical base directory for log storage and prevent any path components from escaping that directory.
- Normalize and validate the UniqueTrackingId field before use, allowing only a limited character set (e.g., alphanumeric plus a small set of safe delimiters) and enforcing a maximum length.
- Reject or sanitize any input containing path metacharacters such as
../, path separators, or null bytes. - Use filesystem APIs that operate on logical file names or identifiers and derive actual paths server-side, rather than accepting paths or path fragments from clients.
- Run the OliveTin process with the least filesystem privileges required so that, even if a path issue arises, the process cannot write to sensitive system-wide locations.
How teams detect issues like this
Organizations can detect and monitor for similar vulnerabilities using a mix of code-focused and operational approaches:
- Static analysis: Configure automated checks to flag any filesystem operations where untrusted input contributes to a path, especially where
../or path separators are not filtered or where paths are built by string concatenation. - Code review: During manual review, scrutinize log-writing and file-creation logic to ensure user-controlled fields are normalized and constrained to a safe directory. Look for patterns where request parameters appear in file paths.
- Runtime monitoring: Instrument logging to capture unexpected log file creation in unusual directories, and monitor for file writes outside the intended log directory by the OliveTin process.
- Policy enforcement: Establish secure coding guidelines that require directory traversal protections, path canonicalization, and use of centralized helper functions for file operations that encapsulate these rules.

