T09 · Insecure Skill Coding Practices
- Location
codeup_cli.py:47- Finding
Personal Access Token Exposed in Git Command-Line Arguments
- Content
View full analysis
.git" ``` `SKILL.md:143-146` duplicates the vulnerable implementation: ```python git_url = f"https://oauth2:{token}@codeup.aliyun.com/{project_path}.git" subprocess.run( ['git', 'clone', '--quiet', '--depth=1', git_url, repo_path], ``` ### Technical Analysis The personal access token is interpolated directly into an HTTPS repository URL and passed to `git clone` as a command-line argument. Although `subprocess.run` uses an argument list and is therefore not directly vulnerable to shell command injection, the resulting Git process contains the complete credential-bearing URL in its argument vector. Depending on operating-system process visibility controls, other local users, privileged monitoring agents, audit systems, crash reporters, or process telemetry collectors may be able to observe and retain the command line. The documented shell examples also expand the token before starting Git and may expose it through shell tracing, command auditing, or other terminal instrumentation. The exception handler returns Git's stderr without credential reda ...[truncated 1716 chars]- Remediation
View remediation
