/

CVE-2026-31817

Severity:

HIGH RISK

(8.5)

Path Traversal in OliveTin saveLogs Feature

CVE-2026-31817

Analyzed

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write on Server Filesystem

Severity:

HIGH RISK

(8.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/OliveTin/OliveTin/security/advisories/GHSA-364q-w7vh-vhpc

Frequently asked

questions

Yes, in typical deployments it can be triggered remotely through the web-exposed StartAction API, as long as the attacker can submit requests containing a crafted UniqueTrackingId while saveLogs is enabled.

The attacker must be able to invoke the StartAction API and control the UniqueTrackingId field. Whether that requires authentication depends on how OliveTin is configured, but the issue does not require shell access or local filesystem access on the host.

The most robust fix is to treat UniqueTrackingId purely as a logical identifier, restrict it to a safe character set and length, and resolve all log file paths exclusively within a predefined log directory using canonicalization to prevent directory traversal. File path construction should not trust any client-controlled data.

Adopt a defensive design pattern where any path involving user input is built through vetted helper functions that enforce allowed directories, sanitize input, and normalize paths. Combine this with secure coding guidelines, automated static analysis for path traversal patterns, and least-privilege filesystem permissions for application processes.

Find out what's already
exploitable in your codebase.