T09 · Insecure Skill Coding Practices
- Location
scripts/publish_report.py:376- Finding
Repository Path Escape Allows Modification of Files Outside the Target Repository
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a mostly coherent report publisher, but it also performs persistent GitHub and SSH account setup and has a path-boundary bug that can write outside the target repository.
Install only if you are comfortable with an agent publishing to GitHub and changing persistent local/account state. Prefer running bootstrap with --skip-ssh and --skip-gh-login unless you intentionally want it to manage GitHub authentication, review --config-path carefully, use --dry-run first, and confirm the target repo/remotes before allowing push or PR creation.
scripts/publish_report.py:376Repository Path Escape Allows Modification of Files Outside the Target Repository
scripts/bootstrap_github.sh:117Bootstrap Performs Account-Wide Git and SSH Credential Provisioning by Default
The declared purpose is report publishing, but the documented workflow also performs global git identity changes, GitHub authentication, SSH key generation/upload, cloning, and remote configuration. This mismatch hides materially more sensitive behavior than users would reasonably expect, which can lead to credential changes, account linkage, or repository access modifications under the guise of a content-publishing task.
Referencing the user’s default ~/.ssh/id_ed25519 path is not inherently malicious, but in this script it is part of a workflow that creates, reads, and uploads authentication material tied to the user’s GitHub account. In a report-publishing skill, touching long-lived personal SSH credentials is overly invasive and increases the risk of unintended credential exposure, misuse, or account modification.
if [[ $SKIP_SSH -eq 0 ]]; then
need_cmd ssh
need_cmd ssh-keygen
KEY_PATH="${HOME}/.ssh/id_ed25519"
PUB_PATH="${KEY_PATH}.pub"
if [[ ! -f "$KEY_PATH" ]]; then
The skill invokes shell commands that can read/write files, access the network, and mutate git state, but it does not declare any explicit tool scope or permission boundaries. That makes the effective authority of the skill opaque to users and reviewers, increasing the chance of over-privileged execution or accidental sensitive actions.
The bootstrap instructions trigger sensitive account and credential operations, including git identity setup, GitHub auth, SSH key upload, and permission validation, without an explicit warning that user account state will be changed. In context, this is more dangerous because the skill is framed as a report publisher, so users may not anticipate persistent auth or SSH modifications.
The publish workflow copies files, edits repository configuration, creates branches, commits, pushes remotely, and may open a PR, but it does not present an explicit safety warning about local mutations and outbound network actions. That can cause unreviewed changes to be written and transmitted to remotes before the user fully understands the side effects.
The instruction 'Use one sentence in Chinese' imposes a specific language requirement. The file does not offer the user a language choice or explain why Chinese is mandatory for policy or region-specific reasons.
The script’s documented behavior includes global Git identity configuration, GitHub CLI authentication, SSH key generation/upload, and remote permission probing, which materially exceed the narrow report-publishing purpose in the skill metadata. In an agent skill context, these account-level changes expand the trust boundary and can modify a user’s global development environment and GitHub access in ways unrelated to publishing a report.
This section generates an SSH key under the user’s home directory, attempts GitHub CLI login, enumerates existing account keys, and uploads a new SSH key to the user’s GitHub account. Those are sensitive credential-management operations with persistent account impact, and they are not necessary for merely copying report assets or updating a config file, making them especially risky in an automation skill.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
if [[ ! -f "$KEY_PATH" ]]; then
info "Generating SSH key: $KEY_PATH"
mkdir -p "${HOME}/.ssh"
chmod 700 "${HOME}/.ssh"
ssh-keygen -t ed25519 -C "$GIT_EMAIL" -f "$KEY_PATH" -N ""
else
info "Existing SSH key found: $KEY_PATH"
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run_cmd(cmd: list[str], cwd: Path, check: bool = True) -> subprocess.CompletedProcess[str]:
result = subprocess.run(
cmd,
cwd=str(cwd),
text=True,
The default abstract is hard-coded in Chinese, and the CLI description also targets a Chinese-language site, but the script does not offer any language selection or explicit opt-in for generated content language. This can violate language/locale policy when users expect locale-neutral behavior or need a different language.
The usage text frames cloning and verification as optional helper actions, but the script is fundamentally a GitHub environment bootstrap tool that alters global identity, SSH state, and account authentication. In a security review, this kind of scope mismatch is dangerous because it can mislead operators into authorizing broader system and account changes than the skill description suggests.
No suspicious patterns detected.