Skip to content

OliveTin's unsafe parsing of UniqueTrackingId can be used to write files

High severity GitHub Reviewed Published Mar 9, 2026 in OliveTin/OliveTin • Updated Mar 11, 2026

Package

gomod github.com/OliveTin/OliveTin (Go)

Affected versions

< 0.0.0-20260309102040-b03af0e2eca3

Patched versions

0.0.0-20260309102040-b03af0e2eca3

Description

When the saveLogs feature is enabled, OliveTin persists execution log entries to disk. The filename used for these log files is constructed in part from the user-supplied UniqueTrackingId field in the StartAction API request. This value is not validated or sanitized before being used in a file path, allowing an attacker to use directory traversal sequences (e.g., ../../../) to write files to arbitrary locations on the filesystem.

Affected Code

Entry point — service/internal/api/api.go (line 130):

The UniqueTrackingId from the API request is passed directly to the executor without validation:

execReq := executor.ExecutionRequest{
    Binding:    pair,
    TrackingID: req.Msg.UniqueTrackingId, // user-controlled, no validation
    // ...
}

Tracking ID accepted as-is — service/internal/executor/executor.go (lines 508–512):

The tracking ID is only replaced with a UUID if it is empty or a duplicate. Any other string, including one containing path separators, is accepted:

_, isDuplicate := e.GetLog(req.TrackingID)

if isDuplicate || req.TrackingID == "" {
    req.TrackingID = uuid.NewString()
}

Filename construction — service/internal/executor/executor.go (line 1042):

The tracking ID is interpolated directly into the log filename:

filename := fmt.Sprintf("%v.%v.%v",
    req.logEntry.ActionTitle,
    req.logEntry.DatetimeStarted.Unix(),
    req.logEntry.ExecutionTrackingID,
)

File write — service/internal/executor/executor.go (lines 1068–1069 and 1082–1083):

The filename is joined to the configured log directory using path.Join, which calls path.Clean internally. path.Clean resolves .. path segments, causing the final file path to escape the intended directory:

// Results file (.yaml)
filepath := path.Join(dir, filename+".yaml")
err = os.WriteFile(filepath, data, 0600)

// Output file (.log)
filepath := path.Join(dir, filename+".log")
err := os.WriteFile(filepath, []byte(data), 0600)

Proof of Concept

An attacker sends the following StartAction request (Connect RPC or REST):

{
  "bindingId": "<any-executable-action-id>",
  "uniqueTrackingId": "../../../tmp/pwned"
}

Assuming the action title is Ping the Internet and the timestamp is 1741320000, the constructed filename becomes:

Ping the Internet.1741320000.../../../tmp/pwned

When path.Join processes this with a configured results directory like /var/olivetin/logs:

path.Join("/var/olivetin/logs", "Ping the Internet.1741320000.../../../tmp/pwned.yaml")

path.Clean resolves the traversal:

  1. Path segments: ["var", "olivetin", "logs", "Ping the Internet.1741320000...", "..", "..", "..", "tmp", "pwned.yaml"]
  2. The .. segments traverse upward past the log directory.
  3. Final resolved path: /tmp/pwned.yaml

Two files are written:

  • .yaml file — contains YAML-serialized InternalLogEntry (action title, icon, timestamps, exit code, output, tags, username, tracking ID)
  • .log file — contains the raw command output (potentially attacker-influenced if the action echoes its arguments)

Impact

  • Arbitrary file write to any path writable by the OliveTin process.
  • OliveTin frequently runs as root inside Docker containers, so the writable scope is often the entire filesystem.
  • An attacker could:
    • Overwrite OliveTin's own sessions.yaml to inject authenticated sessions.
    • Write to entity file directories to inject malicious entity data.
    • Write to system cron directories or other locations to achieve remote code execution.
    • Cause denial of service by overwriting critical system files.

Suggested Fix

Validate the UniqueTrackingId to ensure it only contains safe characters before use. A strict UUID format check is the simplest approach:

import "regexp"

var validTrackingID = regexp.MustCompile(`^[a-fA-F0-9\-]+$`)

// In ExecRequest, before accepting the user-supplied ID:
if req.TrackingID == "" || !validTrackingID.MatchString(req.TrackingID) {
    req.TrackingID = uuid.NewString()
}

Alternatively, sanitize the filename in stepSaveLog by stripping or rejecting path separators and .. sequences.

References

@jamesread jamesread published to OliveTin/OliveTin Mar 9, 2026
Published by the National Vulnerability Database Mar 10, 2026
Published to the GitHub Advisory Database Mar 11, 2026
Reviewed Mar 11, 2026
Last updated Mar 11, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
None
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:L

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(49th percentile)

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

CVE ID

CVE-2026-31817

GHSA ID

GHSA-364q-w7vh-vhpc

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.