Back to skill

Security audit

Eval Repo

Security checks for vulnerabilities and agentic risk

Overview

The skill broadly matches its stated repository-evaluation purpose, but it uses high-impact Gitea admin credentials and under-scoped persistent write paths that need human review before installation.

Review this before installing. Use only in a controlled environment unless the publisher replaces the admin token with least-privilege credentials, enforces HTTPS to a trusted Gitea host, moves authorization into the save path, narrows or separates system-config administration, pins dependencies, and documents how fetched repository content and KB writes are handled.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
env-example.txt:1
Finding

Site-administrator token and private repository content transmitted over plaintext HTTP

Content
View full analysis
dict: return {"Authorization": f"token {ADMIN_TOKEN}", "Content-Type": "application/json"} def api(method: str, path: str, *, json_body: dict | None = None, params: dict | None = None, ok: tuple[int, ...] = (200, 201, 204)): if not GITEA_URL: raise GiteaError("GITEA_URL is not configured") resp = requests.request( method, f"{GITEA_URL}/api/v1{path}", headers=headers(), json=json_body, params=params, timeout=30, ) ``` ### Technical Analysis The example environment configures Gitea through plaintext HTTP at an external bare IP address. The setup script automatically copies this value into `.env`, and the API client sends `GITEA_ADMIN_TOKEN` in the `Authorization` header on every request. HTTP provides no confidentiality or server authentication. A network-positioned attacker can observe the authorization header and request or response bodies. This includes private knowledge-base documents read from Gitea and evaluations, catalogs, and indexes written back to it. The API client performs no scheme validation that would reject `http://` endpoints. ### Attack Path 1. An operator runs `setup.sh`, causing `env-example.txt` to be copied to `.env`. 2. The operator populates `GITEA_ADMIN_TOKEN` ...[truncated 856 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
_meta.json:9
Finding

Repository-evaluation Skill requires excessive site-administrator privileges

Content
View full analysis
dict: return {"Authorization": f"token {ADMIN_TOKEN}", "Content-Type": "application/json"} ``` ```python # scripts/gitea_api.py:60-65 def token_is_site_admin() -> bool: try: api("GET", "/admin/users", params={"limit": 1}) return True except GiteaError: return False ``` ```python # scripts/gitea_api.py:105-113 def create_repo_for_user(username: str, name: str, description: str, private: bool = True) -> dict: if repo_exists(username, name): return {"created": False, "html_url": f"{GITEA_URL}/{username}/{name}"} data = api("POST", f"/admin/users/{username}/repos", json_body={ "name": name, "private": private, "description": description, "auto_init": True, "default_branch": "main", }) return {"created": True, "html_url": data.get("html_url", f"{GITEA_URL}/{username}/{name}")} ``` ```python # scripts/system_config.py:14-29 def ensure_system_repo() -> None: g.create_bot_repo(SYSTEM_REPO, "paper-kb system control plane", private=True) for name, initial in { "users.json": {}, "teams.json": {}, "chat_bindings.json": {}, "pending_chat_bindings.json": {}, "chat_binding_events.json": [], "sources.json": {}, "jobs.json": {}, "active_tasks.json": {}, "permissions.json": {}, }.items(): g.ensure_fi ...[truncated 1981 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/save_eval.py:14
Finding

Evaluation save interface permits privileged writes to arbitrary Gitea repositories

Content
View full analysis
None: parser = argparse.ArgumentParser() parser.add_argument("--owner", required=True) parser.add_argument("--repo", required=True) parser.add_argument("--title", required=True) parser.add_argument("--eval_file", required=True) parser.add_argument("--brief", default="") parser.add_argument("--keywords", default="") parser.add_argument("--score", default="") parser.add_argument("--source_url", default="") parser.add_argument("--scope", default="personal") parser.add_argument("--project_id", default="") args = parser.parse_args() src = Path(args.eval_file) if not src.exists(): out(json_fail("eval_file_not_found", f"找不到评估草稿:{src}")) return safe = sanitize_filename(args.title) path = f"summaries/projects/{safe}.md" try: g.put_file(args.owner, args.repo, path, src.read_text(encoding="utf-8"), f"paper-kb eval repo: {safe}") cat = catalog.read(args.owner, args.repo) entry = { "title": args.title, "file": path, "type_key": "project", "doc_type": "开源项目", "brief": args.brief, "keywords": [x.strip() for x in args.keywords.split(",") if x.strip()], "score": args.score, "scope": args.scope, "project_id": args.project_id, "source_type": "GitHub", "source_url": args.source_url, "created_at": now_str(), "updated_at": now_str(), } replaced = catalog.upsert_document(cat, entry) catalog.write(args.owner, args.repo, cat) catalog.regen_index(args.owner, args.repo, args.repo, cat) ``` ### Technical Analysis `resolve_eval_targe ...[truncated 1917 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
scripts/fetch_github.py:54
Finding

Attacker-controlled GitHub files are passed into the agent evaluation context without an explicit trust boundary

Content
View full analysis
str: url = f"https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path}" try: r = requests.get(url, headers={"User-Agent": "paper-kb-v3"}, timeout=20) except requests.RequestException: return "" return r.text if r.status_code == 200 else "" ``` ```python # scripts/fetch_github.py:79-107 readme = "" for name in ["README.md", "readme.md", "README.rst", "README.txt", "README"]: readme = raw(owner, repo, branch, name) if readme.strip(): break deps = {} for dep in DEP_FILES: text = raw(owner, repo, branch, dep) if text.strip(): deps[dep] = text[:8000] parts = [ f"# GitHub 仓库:{data.get('full_name', f'{owner}/{repo}')}", f"地址:{data.get('html_url')}", f"简介:{data.get('description') or ''}", f"主语言:{data.get('language') or ''}", f"Stars:{data.get('stargazers_count', 0)}", f"Forks:{data.get('forks_count', 0)}", f"Open issues:{data.get('open_issues_count', 0)}", f"最近提交:{(data.get('pushed_at') or '')[:10]}", "", "## README", readme or "(未获取到 README)", "", "## 依赖文件", ] for name, text in deps.items(): parts += [f"### {name}", "```", text, "```"] full_text = "\n".join(parts)[:MAX_CHARS] tmp = Path(os.environ.get("TMP", "/tmp")) / "paperkb" tmp.mkdir(parents=True, exist_ok=True) text_path = tmp / f"github_{owner}_{repo}.txt" text_path.write_text(full_text, encoding="utf-8") ``` ```markdown ### 1. 抓取 GitHub 信息 ```bash python3 scripts/fetch_github.py --url "" ``` 脚本返回 `text_path`,里面包含 README、依赖文件和仓库元信息。 ### 2. 确定保存目标 先解析目标: ```bash python3 scripts/resolve_eval_target.py \ --sen ...[truncated 2299 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Installation uses unpinned third-party dependencies without integrity verification

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (45)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the implementation creates/manages a private bot repository, reads and writes system configuration files (users, teams, permissions, jobs, chat bindings), and manages control-plane data, then this skill has deep administrative reach unrelated to repository evaluation. In this context, such hidden authority is extremely dangerous because compromise or misuse could alter platform state, permissions, task control, and organizational metadata far beyond the user’s request.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/gitea_api.py (reported line 20)May include surrounding context.

python
except ImportError:
        return
    here = Path(__file__).resolve().parent
    for candidate in (here / ".env", here.parent / ".env"):
        if candidate.exists():
            load_dotenv(candidate)
            return

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code loads an admin-scoped token and uses it for all API requests, while also exposing site-admin functionality checks and admin repository creation paths. For a repository evaluation skill, this is unjustified privilege; if the skill, runtime, or token is abused, an attacker could gain broad control over the Gitea instance rather than only read target repositories.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This helper includes write-capable operations such as repository creation, file writes, and collaborator changes that exceed the declared evaluation-oriented purpose of the skill. In an agent context, unnecessary mutation capabilities materially increase blast radius: a prompt- or workflow-driven misuse could alter repositories or permissions instead of only reading metadata and producing evaluations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements persistent system control-plane functionality—creating a bot-owned repository and managing users, teams, chat bindings, jobs, tasks, and permissions—which is materially unrelated to a skill described as repository evaluation. That mismatch is dangerous because it expands the skill's authority and attack surface far beyond expected read/evaluation behavior, enabling hidden stateful administration and remote writes under a benign-seeming capability label.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The initialization of users.json, teams.json, chat_bindings.json, pending_chat_bindings.json, chat_binding_events.json, active_tasks.json, and permissions.json gives this skill account-management and authorization-adjacent capabilities that are unjustified for evaluating GitHub repositories. In the context of a repo-evaluation skill, these hidden management surfaces create opportunities for unauthorized binding, privilege manipulation, or covert persistence if the surrounding system invokes them.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · setup.sh (reported line 4)May include surrounding context.

sh
#!/usr/bin/env bash
set -e
python3 -m pip install -r requirements.txt
if [ ! -f .env ]; then cp env-example.txt .env; fi
echo "setup complete"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares no explicit tool scope or permissions despite instructing use of network access, local file reads/writes, and potentially environment-backed scripts. This creates an overbroad execution surface where the agent may run with more capability than users or reviewers expect, increasing the risk of unintended data access, external fetching, and persistence.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill description does not clearly warn users that it will fetch external GitHub content and persist generated evaluations, including default writes to a team knowledge base in group chats. This is dangerous because users may unintentionally cause data ingestion or publication into shared organizational storage without informed consent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The provided manifest context says this skill should fetch GitHub repository metadata and project files, generate an evaluation, and save it into a knowledge base. However, the code-level description is only "paper-kb v3 skill: eval_repo," which does not describe those repository-fetching and evaluation behaviors and therefore mismatches the stated manifest purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code writes to the remote repository via g.put_file to update catalog.json, but there is no confirmation prompt, user-visible logging, or warning in the file indicating that persistent repository content will be modified. Because file writes can affect user data and repository state, the operation should be disclosed somewhere in code or documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The function regenerates and writes index.md to the repository using g.put_file, which is a persistent file modification, but the code provides no visible disclosure, prompt, or warning about overwriting repository content. This is safety-relevant because it can change user-maintained files or documentation state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code returns multiple user-visible error messages exclusively in Chinese, such as on L21, L24, L28, L31, and L33. For a general-purpose skill, this imposes a specific language on users without opt-in or any documented region-specific justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

If GITHUB_TOKEN is present, the script automatically attaches it to GitHub API requests without any explicit consent, scoping checks, or safeguards around where the credential is used. In this skill context, that can cause silent transmission of a bearer token during repository evaluation, increasing the risk of unintended credential use, audit gaps, or abuse if the environment contains an over-privileged token.

Content

No source excerpt is available for this finding.