T01 · Skill Instruction Hijacking
- Location
scripts/github_discovery.py:168- Finding
Untrusted Repository README Content Is Exposed to the Agent Without Prompt-Injection Controls
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears purpose-built for GitHub project discovery, but it needs review because it mixes GitHub token use, local state writes, and untrusted README content without enough guardrails.
Install only if you are comfortable with a skill that queries GitHub, reads repository READMEs, and saves a local search-session file. Use a fine-grained read-only GitHub token, prefer an environment variable over a checked-in .env file, add .env to .gitignore yourself, and treat any README text returned by the tool as untrusted evidence rather than instructions.
scripts/github_discovery.py:168Untrusted Repository README Content Is Exposed to the Agent Without Prompt-Injection Controls
.gitignore:1Documented GitHub Token File Is Not Excluded from Version Control
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Copy to .env and set a GitHub fine-grained token with read-only public repository access.
GITHUB_TOKEN=
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- Python 3.10 或更高版本
- 可访问 `api.github.com`
- 推荐配置 GitHub Personal Access Token
Token 只用于 GitHub API 认证。脚本会优先读取进程环境变量 `GITHUB_TOKEN`,然后读取当前工作目录或 skill 目录下的 `.env` 文件。
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Token 只用于 GitHub API 认证。脚本会优先读取进程环境变量 GITHUB_TOKEN,然后读取当前工作目录或 skill 目录下的 .env 文件。
Copy-Item .env.example .env
编辑 .env:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
configured = os.getenv("GITHUB_TOKEN", "").strip()
if configured:
return configured
return dotenv_github_token((Path.cwd() / ".env", Path(__file__).resolve().parents[1] / ".env"))
def request_json(path: str, token: str | None = None) -> Any:
The entire skill description and operating instructions are written in Chinese, with no indication that users may interact in other languages or that the locale is intentionally restricted for a region-specific use case. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.
The skill instructs the agent to use filesystem writes, local script execution, and network-based GitHub retrieval, but it does not declare any explicit tool scope such as allowed-tools or permissions. That omission weakens least-privilege controls and can let the skill run with broader ambient capabilities than necessary, increasing the chance of unintended file access, command execution, or network use if invoked in a permissive environment.
This code accesses a sensitive credential via GITHUB_TOKEN and then transmits it in the Authorization header to the GitHub API. While the module docstring describes GitHub retrieval generally, there is no explicit user-facing warning, confirmation, or comment disclosing that credentials may be loaded from .env/environment and sent over the network.
The skill creates directories and writes a persistent JSON state file containing search history, discovered repositories, and idea text. Although persistence is part of the module's behavior, there is no explicit user disclosure at the write site or in CLI help that local files will be created or modified.