T09 · Insecure Skill Coding Practices
- Location
SKILL.md:268- Finding
Insecure Plaintext Git Credential Storage and Token Exposure
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:268-270
Vulnerability Type: Plaintext credential storage and sensitive token exposure
Risk Level: Highbash git config --global credential.helper store # ... git remote set-url origin https://<token>@git.example.com/repo.gitTechnical Analysis
The documented configuration enables Git's
storecredential helper, which normally persists credentials unencrypted in a file such as~/.git-credentials. It also instructs users to embed an access token directly in an HTTPS remote URL. Although the example uses a placeholder and does not identify a malicious server, a real token supplied in this position can be retained in.git/config, shell history, command logs, backups, diagnostic output, and configuration listings.HTTPS protects the token while it is transmitted to the Git server, but it does not protect plaintext copies stored locally. This guidance also conflicts with the Skill's claims that credentials are securely configured and that sensitive information is not exposed.
The network operation is relevant to the Skill's remote repository functionality, but storing a reusable token in plaintext is not necessary for that functionality and exceeds minimum secure credential-handling requirements.
Attack Path
- A user replaces the placeholder with a valid repository access token and runs the documented commands.
- The token is persisted unencrypted by the Git credential helper and/or in the repository's remote URL.
- A local process, another user with file access, a support bundle, a backup system, shell-history collection, or accidentally published configuration reads the token.
- An attacker extracts and replays the token against the Git server.
- The attacker performs any repository actions permitted by the token until it expires or is revoked.
Impact Assessment
Successful exploitation exposes the privileges assigned to the compromised token. Depending on its ...[truncated 442 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to use
credential.helper store. - Use an operating-system-backed credential manager, such as Git Credential Manager, macOS Keychain, Windows Credential Manager, or a properly configured secret service.
- Alternatively, use SSH authentication with an SSH agent and a protected private key.
- Configure the remote without embedded credentials, for example:
bash git remote set-url origin https://git.example.com/repo.git- For CI/CD, inject short-lived credentials through the platform's protected secret mechanism instead of writing them into repository configuration.
- Scope tokens to the minimum repository and operations required, assign short expiration periods, and rotate them regularly.
- Ensure logs and diagnostic output redact authenticated URLs.
- If this guidance has already been followed, remove credentials from remote URLs and shell history, delete insecure stored copies, and revoke and replace the exposed token.
- Remove the recommendation to use
