Back to skill

Security audit

Kb Eval Repo

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its repo-evaluation purpose, but it uses a Gitea administrator token and writes review files by default, so it needs careful review before installation.

Install only in a trusted Research KB backend where task JSON cannot be user-forged, Gitea access is restricted to approved KB repositories, and repository writes are explicitly intended. Prefer replacing the administrator token with least-privilege read and write credentials, making writeReview opt-in, and pinning or removing dependencies before broad use.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/run_task.py:43
Finding

Overprivileged Gitea Administrator Token Used Without Repository-Level Authorization

Content
View full analysis
list[dict]: errors = [] if task.get("protocol") != "research_kb_agent_task": errors.append({"code": "INVALID_PROTOCOL", "message": "protocol must be research_kb_agent_task"}) if task.get("taskType") not in {"kb_query", "kb_eval_repo"}: errors.append({"code": "INVALID_TASK_TYPE", "message": "taskType must be kb_query or kb_eval_repo"}) if not task.get("kbTargets"): errors.append({"code": "INVALID_KB_TARGETS", "message": "kbTargets is required"}) if not (task.get("payload") or {}).get("question"): errors.append({"code": "MISSING_QUESTION", "message": "payload.question is required"}) return errors ``` `scripts/run_task.py:67-76`: ```python def gitea_headers() -> dict[str, str]: return {"Authorization": f"token {GITEA_TOKEN}", "Accept": "application/json", "Content-Type": "application/json"} def gitea_api(method: str, path: str, *, json_body=None, ok=(200, 201, 204)) -> object: if not GITEA_URL or not GITEA_TOKEN: raise RuntimeError("GITEA_URL and GITEA_ADMIN_TOKEN are required") response = requests.request(method, f"{GITEA_URL}{path}", headers=gitea_headers(), json=json_body, timeout=60) if response.status_code not in ok: raise RuntimeError(f"Gitea {method} {path} failed: {response.status_code} {response.text[:300]}") return response.json() if response.text else {} ``` `scripts/run_task.py:250-281`: ...[truncated 4559 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned and Unverified Python Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Yes, there is a clear mismatch. The declared purpose describes a substantive evaluation skill for GitHub/open-source repositories within a Research KB workflow. However, the actual code chunk is only a minimal setup script that echoes a status message. While setup scripts can be supporting components, this supplied code does not implement or demonstrate any of the core declared functionality. Therefore, the behavior represented by the code chunk does not accurately match the declared description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script loads and uses GITEA_ADMIN_TOKEN for repository API operations even though the skill’s main purpose is evaluating repo relevance. Using administrative or overly broad credentials in a skill that handles externally influenced input greatly increases blast radius: any bug, prompt abuse, or future feature expansion could lead to unauthorized writes across repositories.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill instructs the agent to fetch GitHub metadata, read repository files, and optionally write a review page, but it declares no explicit tool scope or permission boundaries. That creates an authorization ambiguity where an agent runtime may allow broader network, file, or environment access than the skill's stated business purpose requires, increasing the chance of unintended data access or modification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill mandates exactly one verdict using Chinese phrases (值得深入, 选择性参考, 暂不建议), and the scope/examples are also presented in Chinese. This imposes a specific language/locale in the skill behavior without user opt-in or a documented reason that the skill is region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill allows writing an evaluation report into the selected target repository by default unless writeReview is explicitly false. Default-on modification of repository contents can surprise users, alter tracked knowledge-base content, and be abused to persist unwanted or misleading material in a repo that was expected to be read-only during evaluation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code defines a write primitive that updates repository contents in Gitea, enabling this evaluation skill to modify the knowledge-base repository. In the context of a repo-evaluation/query skill, that is a side effect beyond minimally necessary read-only behavior and creates integrity risk if the skill is triggered on untrusted input or misused repeatedly.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/run_task.py (reported line 181)May include surrounding context.

python
def fetch_github(owner: str, repo: str) -> dict:
    meta = github_get(f"https://api.github.com/repos/{owner}/{repo}")
    if not isinstance(meta, dict):
        raise RuntimeError("GitHub returned an invalid repository response")
    branch = str(meta.get("default_branch") or "main")

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/run_task.py (reported line 196)May include surrounding context.

python
def fetch_github(owner: str, repo: str) -> dict:
    meta = github_get(f"https://api.github.com/repos/{owner}/{repo}")
    if not isinstance(meta, dict):
        raise RuntimeError("GitHub returned an invalid repository response")
    branch = str(meta.get("default_branch") or "main")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The fallback answer string is hard-coded in Chinese, and the rest of the generated report and answer text in this file are also composed exclusively in Chinese. This imposes a locale/language choice on users without any indication of user preference or an opt-in mechanism.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill writes a generated review page by default during normal request handling (writeReview defaults to true), so an evaluation request causes repository mutation without explicit confirmation. This creates an integrity and spam/poisoning risk for the KB, especially because task content and fetched repo metadata can influence what gets persisted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill persists review files back into the KB repository by default without an explicit user-facing warning or confirmation in the code path shown. That hidden state-changing behavior is dangerous because a user may believe they are only requesting analysis while actually causing permanent repository modifications.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency 'requests' is unpinned, so installs may resolve to different versions over time, reducing reproducibility and potentially pulling in a newly vulnerable or incompatible release. In a skill that evaluates repositories and may interact with external content or services, dependency drift modestly increases supply-chain and reliability risk.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests
python-dotenv

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The manifest does not pin 'requests', and the package has known advisories across some versions, so the project cannot demonstrate that installations avoid affected releases. This is not proof that the current environment is vulnerable, but it is a genuine supply-chain weakness because vulnerable versions could be selected unknowingly.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency 'python-dotenv' is also unpinned, which means future installations may fetch different releases with different security properties or behavior. Because dotenv libraries influence environment configuration and secrets handling, version uncertainty can create avoidable security and operational risk.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
requests
python-dotenv

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
85% confidence
Finding

Because 'python-dotenv' is unpinned and has advisories affecting some releases, the dependency state is unverifiable and may resolve to a vulnerable version. Given that dotenv tooling can affect how configuration files and secrets are loaded or written, this uncertainty is a legitimate but low-severity risk.

Content

No source excerpt is available for this finding.