T01 · Skill Instruction Hijacking
- Location
scripts/analyze_repo.py:34- Finding
Untrusted Repository README Content Creates an Indirect Prompt-Injection Channel
- Content
View full analysis
Vulnerability Details
File Location:
scripts/analyze_repo.py:34-38andscripts/analyze_repo.py:111; related workflow inSKILL.md:31-34
Vulnerability Type: Indirect prompt injection through attacker-controlled repository content
Risk Level: HighVulnerable Code
python content = data.get("content", "") try: decoded = base64.b64decode(content).decode("utf-8", errors="ignore") # Only take the first 3000 characters return decoded[:3000] except Exception: return ""The decoded content is then placed directly into the analysis result:
python "readme_excerpt": readme,The documented workflow states that repository details and README content are retrieved and then analyzed by the AI.
Technical Analysis
Repository README content is fully controlled by the repository owner. The implementation decodes up to 3,000 characters of this content and returns it as
readme_excerptwithout sanitization, structural isolation, or a trust-boundary marker.Because the Skill workflow subsequently provides this content to an AI agent for report generation, a malicious README can contain text framed as agent instructions. For example, it could instruct the agent to ignore the requested analysis, misrepresent repository quality, expose unrelated context, or request additional tool actions.
Limiting the README to 3,000 characters reduces volume but does not mitigate prompt injection because a functional injected instruction can be very short. The code also does not distinguish descriptive repository content from imperative instructions.
This is an indirect prompt-injection weakness rather than direct native-code execution. Whether an injected instruction can cause tool use or sensitive disclosure depends on the permissions, surrounding system prompt, and safety controls of the host agent.
Attack Path
- An attacker creates or modifies a public GitHub repository.
...[truncated 1196 chars]
- Remediation
View remediation
Remediation Suggestions
- Treat every README, description, topic, and other repository-provided field as untrusted data.
- Add explicit agent instructions stating that repository content must only be summarized and that instructions embedded in it must never be followed.
- Place README text inside strongly delimited data blocks and label it as untrusted external content.
- Separate untrusted content from system and workflow instructions rather than concatenating both into the same instruction context.
- Prefer structured, non-agent extraction for objective metadata such as language, license, activity, and repository statistics.
- Apply content screening for common prompt-injection patterns, while recognizing that pattern filtering is only defense in depth.
- Require fresh user confirmation before any tool action suggested by repository content.
- Ensure the host agent uses least-privilege tools and cannot expose secrets or perform unrelated actions during repository analysis.
