{"vuln_id":"CVE-2026-75506","aliases":["GHSA-vc6p-m6vx-6cwq","CVE-2026-27626"],"description":"OliveTin: Second-Order OS Command Injection via shellAfterCompleted","published_at":"2026-11-18T21:18:02.260000Z","modified_at":"2026-11-19T16:21:53.657000Z","first_seen_at":"2026-11-21T19:15:20.140726Z","severity":"medium","severity_source":"nvd","cvss_score":6.6,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H","cwe":["CWE-74","CWE-78"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00619,"epss_percentile":0.50569,"nvd_status":"Received","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-75506"},"matched_alias":null,"items":[{"id":10981,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-vc6p-m6vx-6cwq: OliveTin: Second-Order OS Command Injection via shellAfterCompleted","summary":"OliveTin: Second-Order OS Command Injection via shellAfterCompleted\n\n## Summary\n\nOliveTin'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.\n\nThis 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.\n\n## Affected Versions\n\n- All versions containing `shellAfterCompleted` functionality (current codebase through latest)\n\n## Details\n\n### Vulnerable Code Path\n\nIn `service/internal/executor/executor.go`, the `stepExecAfter` function handles post-execution commands:\n\n```go\nfunc stepExecAfter(req *ExecutionRequest) bool {\n    if req.Binding.Action.ShellAfterCompleted == \"\" {\n        return true\n    }\n\n    // These variables are injected WITHOUT any type checking or sanitization\n    args := map[string]string{\n        \"output\":                 req.logEntry.Output,           // Arbitrary command stdout/stderr\n        \"exitCode\":               fmt.Sprintf(\"%v\", req.logEntry.ExitCode),\n        \"ot_executionTrackingId\": req.TrackingID,\n        \"ot_username\":            req.AuthenticatedUser.Username, // User-controlled via trusted headers\n    }\n\n    // Template rendered with unsanitized args\n    finalParsedCommand, err := tpl.ParseTemplateWithActionContext(\n        req.Binding.Action.ShellAfterCompleted,\n        req.Binding.Entity,\n        args,\n    )\n\n    // Directly passed to sh -c — NO safety check\n    cmd := wrapCommandInShell(ctx, finalParsedCommand)\n    // ...\n}\n```\n\nThe `wrapCommandInShell` function (in `executor_unix.go`) executes:\n\n```go\nfunc wrapCommandInShell(ctx *ExecutionContext, finalParsedCommand string) *exec.Cmd {\n    return exec.CommandContext(ctx, \"sh\", \"-c\", finalParsedCommand)\n}\n```\n\n### Why This Bypasses Existing Protections\n\nThe 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.\n\n**`stepExecAfter` calls none of these checks.** The `output` variable is:\n- Not a declared argument with a type — it's internally created\n- Not validated against any regex or type system\n- Not passed through `checkShellArgumentSafety`\n- Directly interpolated into a shell command template\n\n\n\nAffected: Go:github.com/OliveTin/OliveTin\n\nFixed in: 0.0.0-20260728155752-e5d29b68da66\n\nReferences:\nhttps://github.com/OliveTin/OliveTin/security/advisories/GHSA-vc6p-m6vx-6cwq\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-75506\nhttps://github.com/OliveTin/OliveTin/pull/1070\nhttps://github.com/OliveTin/OliveTin/pull/1088\nhttps://github.com/OliveTin/OliveTin/commit/4ef86abee7aac4e4ec4a3200c7ca491ca3501065\nhttps://github.com/OliveTin/OliveTin/commit/e5d29b68da66fd7f99072d6afd336dee2c28876c\nhttps://github.com/OliveTin/OliveTin\nhttps://github.com/OliveTin/OliveTin/releases/tag/3000.17.0","url":"https://osv.dev/vulnerability/GHSA-vc6p-m6vx-6cwq","published_at":"2026-11-18T21:55:09Z","updated_at":"2026-11-18T22:00:04.129389Z","fetched_at":"2026-11-21T19:15:55.946346Z","severity":"critical","cvss_score":9.9,"epss":0.00627,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/OliveTin/OliveTin","vuln_id":"CVE-2026-75506","vuln_ids":["CVE-2026-27626","CVE-2026-75506","GHSA-VC6P-M6VX-6CWQ"],"tags":["osv","go","fix-available"],"cluster_id":2285,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10981","html":"https://vulnwatch.ve1ve2.com/item/10981"}},{"id":2427,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-vc6p-m6vx-6cwq / CVE-2026-75506: OliveTin: Second-Order OS Command Injection via shellAfterCompleted","summary":"OliveTin: Second-Order OS Command Injection via shellAfterCompleted\n\n## Summary\n\nOliveTin'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.\n\nThis 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.\n\n## Affected Versions\n\n- All versions containing `shellAfterCompleted` functionality (current codebase through latest)\n\n## Details\n\n### Vulnerable Code Path\n\nIn `service/internal/executor/executor.go`, the `stepExecAfter` function handles post-execution commands:\n\n```go\nfunc stepExecAfter(req *ExecutionRequest) bool {\n    if req.Binding.Action.ShellAfterCompleted == \"\" {\n        return true\n    }\n\n    // These variables are injected WITHOUT any type checking or sanitization\n    args := map[string]string{\n        \"output\":                 req.logEntry.Output,           // Arbitrary command stdout/stderr\n        \"exitCode\":               fmt.Sprintf(\"%v\", req.logEntry.ExitCode),\n        \"ot_executionTrackingId\": req.TrackingID,\n        \"ot_username\":            req.AuthenticatedUser.Username, // User-controlled via trusted headers\n    }\n\n    // Template rendered with unsanitized args\n    finalParsedCommand, err := tpl.ParseTemplateWithActionContext(\n        req.Binding.Action.ShellAfterCompleted,\n        req.Binding.Entity,\n        args,\n    )\n\n    // Directly passed to sh -c — NO safety check\n    cmd := wrapCommandInShell(ctx, finalParsedCommand)\n    // ...\n}\n```\n\nThe `wrapCommandInShell` function (in `executor_unix.go`) executes:\n\n```go\nfunc wrapCommandInShell(ctx *ExecutionContext, finalParsedCommand string) *exec.Cmd {\n    return exec.CommandContext(ctx, \"sh\", \"-c\", finalParsedCommand)\n}\n```\n\n### Why This Bypasses Existing Protections\n\nThe 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.\n\n**`stepExecAfter` calls none of these checks.** The `output` variable is:\n- Not a declared argument with a type — it's internally created\n- Not validated against any regex or type system\n- Not passed through `checkShellArgumentSafety`\n- Directly interpolated into a shell command template\n\n\n\nAffected packages: go:github.com/OliveTin/OliveTin\nPatched: github.com/OliveTin/OliveTin 0.0.0-20260728155752-e5d29b68da66","url":"https://github.com/advisories/GHSA-vc6p-m6vx-6cwq","published_at":"2026-11-18T21:55:09Z","updated_at":"2026-11-18T21:55:10Z","fetched_at":"2026-11-21T19:15:18.416828Z","severity":"critical","cvss_score":9.9,"epss":0.00627,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/OliveTin/OliveTin","vuln_id":"CVE-2026-75506","vuln_ids":["CVE-2026-27626","CVE-2026-75506","GHSA-VC6P-M6VX-6CWQ"],"tags":["ghsa","go","CWE-74","CWE-78"],"cluster_id":2285,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2427","html":"https://vulnwatch.ve1ve2.com/item/2427"}},{"id":8224,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-75506: OliveTin gives safe and simple access to predefined shell commands from a web interface. From 3000.0.0 until 3000.18.1, OliveTin passes attacker-influenceable…","summary":"OliveTin gives safe and simple access to predefined shell commands from a web interface. From 3000.0.0 until 3000.18.1, OliveTin passes attacker-influenceable output and ot_username values into shellAfterCompleted processing in service/internal/executor/executor.go without applying checkShellArgumentSafety, the shell-safety validation used for primary action execution. The same post-execution template path also expands exitCode without that validation, but the advisory does not establish attacker control of the exit-code value. When an action configures shellAfterCompleted with output or ot_username, shell metacharacters from command output, external data processed by an action, or a trusted-header username can become syntax in the command executed by the stepExecAfter path. This can execute arbitrary commands as the OliveTin process user, including when the primary action uses the safer exec-array mode. This issue is fixed in version 3000.18.1.\n\nReferences:\nhttps://github.com/OliveTin/OliveTin/commit/4ef86abee7aac4e4ec4a3200c7ca491ca3501065\nhttps://github.com/OliveTin/OliveTin/commit/e5d29b68da66fd7f99072d6afd336dee2c28876c\nhttps://github.com/OliveTin/OliveTin/pull/1070\nhttps://github.com/OliveTin/OliveTin/pull/1088\nhttps://github.com/OliveTin/OliveTin/releases/tag/3000.17.0\nhttps://github.com/OliveTin/OliveTin/releases/tag/3000.18.1\nhttps://github.com/OliveTin/OliveTin/security/advisories/GHSA-vc6p-m6vx-6cwq","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-75506","published_at":"2026-11-18T21:18:02.260000Z","updated_at":"2026-11-19T16:21:53.657000Z","fetched_at":"2026-11-21T19:15:31.484014Z","severity":"medium","cvss_score":6.6,"epss":0.00619,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-75506","vuln_ids":["CVE-2026-27626","CVE-2026-75506","GHSA-VC6P-M6VX-6CWQ"],"tags":["CWE-74","CWE-78"],"cluster_id":2286,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/8224","html":"https://vulnwatch.ve1ve2.com/item/8224"}}]}