T09 · Insecure Skill Coding Practices
- Location
SKILL.md:179- Finding
Remote API Responses Are Interpolated into Executable Python Source
- Content
View full analysis
- Remediation
View remediation
"$tmp1" printf '%s' "$PROG2" > "$tmp2" python3 - "$tmp1" "$tmp2" <<'PY' import json import sys with open(sys.argv[1], encoding="utf-8") as file: p1 = json.load(file) with open(sys.argv[2], encoding="utf-8") as file: p2 = json.load(file) # Process the parsed objects here. PY ``` In addition: - Require HTTPS and certificate verification for the DP server. - Reject malformed or unexpectedly large responses. - Validate the parsed JSON against an expected schema. - Apply response size and request timeout limits. - Run operational tooling with a minimally privileged account. - Rotate the API key if exploitation is suspected. ]]>
