VulnWatch by ve1ve2
critical 9.9 EPSS 0.63%

GHSA-vc6p-m6vx-6cwq / CVE-2026-75506: OliveTin: Second-Order OS Command Injection via shellAfterCompleted

Source:
GitHub Security Advisories
Published:
Fetched:
Updated:
Affects:
github.com/OliveTin/OliveTin

https://github.com/advisories/GHSA-vc6p-m6vx-6cwq ↗

ghsagoCWE-74CWE-78

OliveTin: Second-Order OS Command Injection via shellAfterCompleted ## 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 `shellAfterCompleted` functionality (current codebase through latest) ## Details ### Vulnerable Code Path In `service/internal/executor/executor.go`, the `stepExecAfter` function handles post-execution commands: ```go 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: ```go 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 Affected packages: go:github.com/OliveTin/OliveTin Patched: github.com/OliveTin/OliveTin 0.0.0-20260728155752-e5d29b68da66

Linked vulnerabilities (3)

CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H

OliveTin: Second-Order OS Command Injection via shellAfterCompleted

CWE: CWE-74, CWE-78Aliases: CVE-2026-75506, CVE-2026-27626
CVE-2026-75506 medium 6.6 EPSS 0.62% (p51) NVDCVE.orgGHSA
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H

OliveTin: Second-Order OS Command Injection via shellAfterCompleted

CWE: CWE-74, CWE-78Aliases: GHSA-vc6p-m6vx-6cwq, CVE-2026-27626NVD: Received
CVE-2026-27626 critical 9.9 EPSS 0.63% (p51) NVDCVE.org
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

OliveTin gives access to predefined shell commands from a web interface. In versions up to and including 3000.10.0, OliveTin's shell mode safety check (`checkShellArgumentSafety`) blocks several dangerous argument types but not `password`. A user supplying a `password`-typed argument can inject shell metacharacters that execute arbitrary OS commands. A second independent vector allows unauthenticated RCE via webhook-extracted JSON values that skip type safety checks entirely before reaching `sh -c`. When exploiting vector 1, any authenticated user (registration enabled by default,...

CWE: CWE-78NVD: Analyzed

Also reported by (1)