T09 · Insecure Skill Coding Practices
- Location
scripts/scan_gitcode_issues.py:294- Finding
Shell Command Injection in Generated Issue-Closing Scripts
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is mostly a coherent GitCode issue-audit tool, but its optional generated close scripts can be unsafe if attacker-controlled input is included and then run.
Review before installing if you plan to use close-script generation. The read-only report workflow is aligned with the stated purpose, but do not run generated close scripts unless you trust and validate the repository, branch, and GitCode command values, because the current generator does not safely quote them.
scripts/scan_gitcode_issues.py:294Shell Command Injection in Generated Issue-Closing Scripts
The skill invokes Python and can generate output files and shell scripts, but it does not declare any explicit tool scope such as allowed tools or permissions. That creates an authorization gap where an agent may use shell or file-write capabilities more broadly than intended, increasing the chance of unintended command execution or filesystem mutation beyond a read-only audit workflow.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def _run_json(command: str, args: list[str], timeout: int = 300) -> Any:
completed = subprocess.run(
[command, *args],
check=True,
capture_output=True,
This code emits user-facing Markdown tables, section headings, and status messages entirely in Chinese, including generated close-script comments and runtime output. That creates a language/locale constraint without any user opt-in or documented choice, which matches the policy-violation category for forced language.