T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:87- Finding
Automatic Staging and Remote Push of All Repository Changes Without Approval
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 87–93
Vulnerability Type:T05: Unauthorized Access and Privilege Escalation
Risk Level: HighVulnerable Code:
markdown ### 4. Push active git repo if files were edited If any version-controlled files were touched this session, commit and push before closing: ```sh git add -A && git commit -m "session close sync YYYY-MM-DD" && git pushtext ### Technical Analysis The close procedure directs the agent to stage every tracked and untracked change in the active repository, create a commit, and push it to the configured remote. It does not require explicit owner approval, inspection of the staged diff, validation of the repository and destination branch, secret scanning, or restriction to files modified by the agent during the current task. The use of `git add -A` is especially unsafe because it includes unrelated changes, deletions, newly created files, generated artifacts, and potentially sensitive files. This behavior exceeds the permissions required to create a local session journal and may mutate a shared remote repository without authorization. The instruction also conflicts with the safer behavioral rule documented in `references/pattern-keys.md`, which tracks whether the agent avoided committing to a shared repository without owner approval. ### Attack Path 1. A repository or another local process introduces a sensitive, malicious, unfinished, or unrelated file into the working tree. 2. The user or agent triggers the session-close procedure. 3. The Skill executes `git add -A`, staging the entire working tree rather than an explicit set of reviewed files. 4. The Skill creates a commit without presenting the staged changes for approval. 5. `git push` publishes the commit to the repository's configured remote and branch. 6. The staged material becomes available to remote collaborators or downstream automation and ...[truncated 560 chars]- Remediation
View remediation
Remediation Suggestions
- Make committing and pushing opt-in rather than a mandatory close step.
- Obtain explicit user approval immediately before both the commit and the push.
- Display the repository root, current branch, destination remote, and complete staged diff before requesting approval.
- Replace
git add -Awith explicit staging of an allowlisted set of files created or intentionally modified during the session. - Check for untracked files, unrelated pre-existing changes, submodules, symlinks, and unexpected repository boundaries.
- Run an approved secret scanner before committing and block the operation when credentials or sensitive material are detected.
- Do not push directly to protected or shared branches; use a user-approved branch or pull-request workflow.
- Separate local journaling from repository publication so the session can close safely without remote write access.
