T09 · Insecure Skill Coding Practices
- Location
<key> <value> local file="$1" key="$2" value="$3" python3 <<PYEOF import json try: with open("$file") as f: data = json.load(f) except Exception: data = {} data["$key"] = """$value""" with open("$file", "w") as f: json.dump(data, f, indent=2) PYEOF } _build_payload() { # Build JSON payload safely using python3 heredoc # Usage: _build_payload <text> [channel] local text="$1" local channel="${2:-}" python3 <<PYEOF import json, sys payload = {} payload["text"] = ...[truncated 3520 chars]:27- Finding
Arbitrary Python Code Execution Through Unquoted Heredoc Interpolation
- Content
View full analysis
local file="$1" key="$2" value="$3" python3 < [channel] local text="$1" local channel="${2:-}" python3 < [channel] local action="$1" message="$2" status="$3" channel="${4:-}" python3 <- Remediation
View remediation
