Back to skill

Security audit

git-mender

Security checks for vulnerabilities and agentic risk

Overview

This skill is disclosed as an automated GitHub issue fixer, but it needs review because it can read untrusted issue content, edit repositories, and run repository-defined commands on the user's machine.

Review before installing. Use this only with repositories and issue authors you trust, or run it in a disposable/sandboxed development environment. Carefully review commands, diffs, and PR text before approving any push or pull request creation.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:56
Finding
Untrusted GitHub Issue Content Can Hijack Agent Instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:56-78` **Vulnerability Type**: Prompt injection through attacker-controlled issue bodies and comments **Risk Level**: High ### Vulnerable Code ```markdown Retrieve the full issue content including title, body, labels, and comments. ### Strategy A: Use `gh` CLI (preferred) Run in the terminal: ```bash gh issue view {number} --repo {owner}/{repo} --comments ``` If the command succeeds, extract from the output: - **Title** - **Body / Description** - **Labels** - **Comments** (may contain important context, reproductions, or workarounds) ### Strategy B: Fallback to `fetch_content` If `gh` is not installed or the command fails: 1. Use the `fetch_content` tool with the issue URL: `https://github.com/{owner}/{repo}/issues/{number}` 2. Parse the fetched page content to extract: - Issue title and body - Any referenced file paths, error messages, or stack traces - Comments from maintainers or the reporter ``` ### Technical Analysis GitHub issue bodies and comments are controlled by repository users and may contain arbitrary text. The workflow explicitly loads this content into the Agent's context and instructs the Agent to treat comments as potentially important context. It does not establish a trust boundary, delimit the retrieved text as inert data, or prohibit following instructions embedded in that text. An attacker can therefore place prompt-injection directives inside an issue description or comment. Such directives could attempt to override the Skill workflow, redirect repository analysis, induce access to unrelated local files, request unauthorized tool operations, suppress security checks, or influence generated source changes. The later requirement for approval before pushing or creating a pull request limits some consequences, but it does not protect earlier phases in which the Agent may clone repositories, inspect local files, modify code, and execute project commands. ### A ...[truncated 1457 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Declare all issue titles, bodies, labels, comments, web pages, and repository contents to be untrusted data. 2. Add an explicit instruction that the Agent must never follow commands or policy statements found in retrieved issue content. 3. Wrap fetched content in clear delimiters and state that it may only be used to extract factual bug-report information. 4. Reject requests from issue content to access files outside the selected repository, reveal secrets, alter safety controls, or contact undeclared endpoints. 5. Require separate user approval before any action outside read-only issue analysis, including cloning, editing files, or executing commands. 6. Present a sanitized summary of the issue rather than carrying raw issue comments into later decision-making phases. 7. Detect common prompt-injection patterns and warn the user when issue text contains tool instructions, role changes, credential requests, or attempts to override the workflow. 8. Apply an allowlist of permitted tools, directories, and network destinations throughout the run. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:221
Finding
Repository-Controlled Test and Lint Commands Execute Without Isolation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:112-118, 221-251` **Vulnerability Type**: Unsandboxed execution of code from an untrusted cloned repository **Risk Level**: High ### Vulnerable Code ```markdown If not found, clone it: ```bash gh repo clone {owner}/{repo} /tmp/{repo} ``` If `gh` is not available: ```bash git clone https://github.com/{owner}/{repo}.git /tmp/{repo} ``` ``` ```markdown ### 6.1 Detect Project Type and Test Runner Look for common indicators: | File | Likely runner | |---|---| | `package.json` | `npm test` or `npx jest` or `npx vitest` | | `Cargo.toml` | `cargo test` | | `go.mod` | `go test ./...` | | `pyproject.toml` / `setup.py` | `pytest` | | `Makefile` | `make test` | | `pom.xml` | `mvn test` | | `build.gradle` | `./gradlew test` | ### 6.2 Run Tests ```bash # Run the full test suite or scoped tests related to the changed files {test_command} ``` - If tests **pass**, proceed to Phase 7. - If tests **fail**, analyze the failure, adjust the fix, and re-run. ### 6.3 Lint / Format Check (if available) Check if the project has lint or format tools configured, and run them: ```bash # Examples npm run lint 2>/dev/null cargo clippy 2>/dev/null go vet ./... 2>/dev/null ``` ``` ### Technical Analysis The Skill accepts a user-selected GitHub repository, clones it, detects its build system, and runs repository-defined tests and lint tasks. These operations are not passive validation. Common test and build systems execute arbitrary code supplied by the repository: - `npm test` and `npm run lint` execute package scripts. - `make test` executes commands from the repository's `Makefile`. - Gradle and Maven execute build plugins and project tasks. - `pytest` imports test modules, configuration files, and plugins. - Cargo build scripts can execute during compilation. - A repository can supply executable wrappers such as `gradlew`. The workflow does not require sandboxing, source trust verification, command review, netw ...[truncated 2024 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Execute all cloned-repository commands inside a disposable container, virtual machine, or equivalent sandbox. 2. Mount only the target repository into the sandbox and avoid mounting the user's home directory, SSH configuration, Git credentials, cloud credentials, or Agent configuration. 3. Clear inherited environment variables and provide only a minimal allowlist required for testing. 4. Disable network access by default. If dependencies must be downloaded, use tightly restricted destination allowlists and a separate dependency-fetch phase. 5. Run the sandbox as an unprivileged user with a read-only base filesystem, resource limits, process limits, and a disposable writable workspace. 6. Display the exact command and explain that repository-controlled code may execute before requesting explicit user approval. 7. Inspect package scripts, build files, test configuration, plugins, wrapper scripts, and lifecycle hooks before execution. 8. Do not automatically run repository-provided wrapper executables or commands derived from issue text. 9. Prefer trusted tool binaries from a controlled environment and use flags that disable lifecycle scripts or plugins where supported. 10. Destroy the sandbox after verification and report all network, filesystem, and subprocess activity when practical. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description promises a functional skill that automates fixing GitHub issues and creating pull requests. The actual code chunk is strictly an installation script for deploying SKILL.md into a local skills directory and optionally uninstalling it. While installer behavior can be a supporting component, this chunk by itself does not perform the core declared functionality at all. Therefore the description does not accurately represent what this supplied code chunk actually does.

Session Persistence

Medium
Category
Rogue Agent
Content
### Option 3: Manual Install

```bash
mkdir -p ~/.qoder/skills/git-mender
cp SKILL.md ~/.qoder/skills/git-mender/SKILL.md
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Skill Enumeration

Medium
Category
Agent Snooping
Content
```bash
mkdir -p ~/.qoder/skills/git-mender
cp SKILL.md ~/.qoder/skills/git-mender/SKILL.md
```

## 🚀 Usage
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The manifest description says the skill will automatically fix GitHub issues, but it does not clearly warn that it may modify repository code and submit pull requests autonomously. For a skill with write-side effects on source code and GitHub workflows, omission of that warning can mislead users about the level of autonomy and the scope of actions taken, increasing the chance of unintended code changes or unauthorized PR submissions.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The security manifest is inaccurate: the script explicitly creates and writes to ~/.qoder/skills/git-mender/ despite claiming no local files are written. Misleading installation metadata can cause users or automated reviewers to underestimate filesystem changes, reducing transparency and weakening trust and review controls.

Intent-Code Divergence

Low
Confidence
99% confidence
Finding
The manifest claims the installer contacts GitHub via 'git clone only', but this script never performs any network operation. While this is not direct code execution risk, inaccurate network-use disclosures undermine security review and may mask future unexpected outbound behavior if users rely on the manifest.

Static analysis

No suspicious patterns detected.