Back to skill

Security audit

Kb Literature Review

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent review-generation purpose, but it uses an admin Gitea token and writes to caller-selected repositories by default without a clear authorization or confirmation boundary.

Review before installing. Use only with a tightly scoped Gitea service token, server-side validation of allowed KB repositories, and explicit opt-in for writing review files. Pin dependencies and remove unused python-dotenv before deployment.

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:46
Finding

Administrator Token Used with Caller-Controlled Repository Targets

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_literature_review"}: errors.append({"code": "INVALID_TASK_TYPE", "message": "taskType must be kb_query or kb_literature_review"}) 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 ``` ```python def 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=headers(), json=json_body, timeout=60) ``` ```python def read_candidates(task: dict, topic: str) -> list[dict]: page_terms = terms(topic + " " + str((task.get("payload") or {}).get("question", ""))) candidates = [] for target in task.get("kbTargets") or []: owner = target["repoOwner"] repo = target["repoName"] ``` ```python def write_review(task: dict, title: str, md: str) -> str: target = (task.get("kbTarget ...[truncated 3586 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned and Unnecessary Python Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description presents the skill as a query/review generator, but the workflow instructs it to write review files into the repository, which is a materially different and state-changing behavior. This can mislead users and orchestration layers into granting or invoking the skill under read-only expectations while it performs persistence or repository modification.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description presents the skill as a query/review generator, but the workflow instructs it to write review files into the repository, which is a materially different and state-changing behavior. This can mislead users and orchestration layers into granting or invoking the skill under read-only expectations while it performs persistence or repository modification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code uses GITEA_ADMIN_TOKEN for all API access, including reading arbitrary repository contents and writing files. For a literature review skill this is excessive privilege, so any misuse, prompt/task manipulation, or downstream bug can lead to broad repository compromise rather than a narrowly scoped output action.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instruction 'Generate a Chinese review' imposes a fixed language requirement. There is no opt-in, fallback, or justification that this skill is region-specific, so it violates the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow instructs the agent to write reviews/<topic>-专项综述.md by default unless an option is explicitly set to false, but it does not require a clear warning or consent for modifying repository contents. Silent persistence can overwrite expectations of a read/query operation, create unwanted artifacts, and be abused to plant misleading content into shared knowledge bases.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest declares access to highly sensitive environment variables, including an admin token, without any visible user-facing justification or warning in this file. In a skill that processes query-driven literature-review tasks, exposing administrative credentials increases the blast radius if the skill is compromised, over-permissioned, or later combined with prompt-injection or unintended repository operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's topic extraction and generated output are strongly oriented toward Chinese, including Chinese stop words, Chinese regex patterns, Chinese fallback names, and Chinese response text. There is no natural-language indication that users can opt into another language or that the locale restriction is intentional and documented, which can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill performs a persistent write to the first configured KB repository by default, even though the described use case is a literature/query-style synthesis. This creates an integrity risk: a user asking for a review can unintentionally cause repository modification, and task-controlled content can be committed into a knowledge base without a distinct approval step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The repository write occurs automatically when writeReview is absent because the default is True, and there is no user-facing confirmation gate. In the context of a knowledge-review skill, silent mutation of a repository is dangerous because users may expect a read-only answer while the agent creates or overwrites content in the KB.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description lists several high-level capabilities and says the skill is 'usable from the query page,' but it does not clearly define the exact activation phrases, scope boundaries, or when the skill should not be invoked. In a manifest file, this kind of broad capability description can contribute to ambiguous triggering if the surrounding system relies on description text for routing.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency requests is unpinned, so builds may resolve to different versions over time, reducing reproducibility and potentially introducing a vulnerable or breaking release without review. In a skill that may perform KB-backed networked operations, dependency drift slightly increases supply-chain risk even though the manifest alone does not prove exploitation.

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
77% confidence
Finding

requests has known advisories, and because no version is pinned, it is impossible to verify from this manifest whether deployment will install a fixed or affected release. The danger is contextual and indirect: if the skill or its runtime makes outbound HTTP requests, an affected requests version could expose credentials or weaken transport/security behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency python-dotenv is also unpinned, which allows non-deterministic installs and can silently pull in a newly published vulnerable or incompatible version. This is a supply-chain hygiene issue rather than direct evidence of compromise, but it weakens deployment integrity.

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
72% confidence
Finding

python-dotenv has known advisories, and the absence of version pinning means the installed package may or may not be vulnerable. If this skill or surrounding runtime uses .env file manipulation/loading in writable directories, a vulnerable version could contribute to unsafe file handling or environment poisoning scenarios.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The gitea_api helper sends HTTP requests to the configured Gitea server, and downstream callers use it to read repository trees, fetch file contents, and write generated review files based on task input. The file contains no user-facing logging, prompt, or explanatory comment/docstring warning that repository metadata and content will be transmitted to an external service endpoint.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The generated markdown frontmatter sets sources: [], but the review body is explicitly built from selected candidate pages and later cites those pages in the result payload. This documentation inside the produced file contradicts the actual provenance of the generated review.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This JSON task explicitly sets "answerLanguage": "zh-CN", which imposes a specific locale in the task payload. Under the policy criteria, forcing a language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly justified or optional.

Content

No source excerpt is available for this finding.