T09 · Insecure Skill Coding Practices
- Location
scripts/install_ga4_openclaw.sh:28- Finding
Persistent Shell Command Injection Through Unsanitized GA4 Property ID
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi ``` - Do not interpolate shell variables into Python source. Pass values as command-line arguments or environment variables: ```bash python3 - "$SHELL_RC" "$PROPERTY_ID" <<'PY' import sys from pathlib import Path rc = Path(sys.argv[1]) property_id = sys.argv[2] PY ``` - Avoid modifying `.bashrc` or `.zshrc` when possible. Store the property ID in a dedicated configuration file with restrictive permissions and load it explicitly. - If a shell assignment must be generated, use a robust shell-escaping mechanism rather than manual quoting. - Write startup-file changes atomically and preserve the original file so the operation can be safely rolled back. ]]>
