Back to skill

Security audit

Kb Maintenance

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly fits its KB maintenance purpose, but it can expose the Gitea bot token if an input payload redirects authenticated requests.

Review before installing. This should only run with trusted payload inputs or after changing the Gitea client so authenticated requests use a trusted configured HTTPS origin and allowed owner/repo, not payload-provided destinations. Use a least-privileged bot token limited to the intended KB repository, and rotate the token if untrusted payloads may already have been used.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/gitea_api.py:15
Finding

Environment Gitea Token Disclosure Through Payload-Controlled Server URL

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description is narrowly about scheduled maintenance of six team overview pages plus hidden status files, with careful avoidance of ordinary page rewrites. The supplied code instead is a generic catalog/index module. It manipulates a catalog.json-like structure, processes arbitrary page entries, normalizes relations across many page categories, and renders a broad 'Knowledge Base Index' markdown document. This is a materially different primary purpose from maintaining only six overview pages. While both relate to a knowledge base, the implementation shown lacks the declared maintenance behavior, change inspection logic, status-file writing, and scope limitation to overview pages.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises substantive KB maintenance behavior involving reading existing team KB content, reasoning over recent changes, selectively updating overview pages, and writing status files. The actual code chunk contains only a minimal setup script that verifies Python 3 is installed and echoes a readiness message. This is materially different from the declared primary purpose and lacks the described capabilities entirely.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares access to environment variables, filesystem reads/writes, and network-reachable Gitea operations, but does not declare an explicit tool/permission scope. In an agent setting, missing scope boundaries increases the chance of over-broad access, misuse of secrets such as GITEA_BOT_TOKEN, or unintended writes beyond the intended maintenance workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The primary operational instructions begin under a Chinese heading and continue in Chinese, which imposes a language requirement on operators or downstream agents. The file does not offer a language choice or explain that the skill is intentionally limited to a Chinese-language environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code performs remote repository content creation or modification via PUT requests to the Gitea API, which can change persistent project data. There is no confirmation prompt, user-facing log message, or explanatory comment/docstring in this file warning that calling these methods will write to the repository.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The overview target metadata hard-codes user-facing titles such as "团队总览" and related labels in Chinese. Under the policy, locale-specific language is a violation unless the skill offers user opt-in or clearly documents that the tool is intentionally region-specific, which this file does not do.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest says this skill should incrementally update only the six overview pages and write hidden maintenance status files, while avoiding rewriting ordinary knowledge pages. Here, after overview-page changes, the code also rewrites top-level shared metadata files catalog.json and index.md, which extends behavior beyond the stated 'only the six overview pages' plus hidden status files scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The validation text states that kb_maintenance may only write fixed overview pages, presenting a stricter intent than the implementation actually follows. Elsewhere in the file, the code writes catalog.json, index.md, and hidden maintenance status/run-history files, so the inline intent communicated by this message is contradicted by actual behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code reads multiple values from environment variables, including platform and repository identifiers, and silently incorporates them into the payload. There is no confirmation prompt, logging, comment, or docstring disclosing that runtime behavior depends on environment-provided data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The function creates parent directories and writes JSON output to a caller-supplied path, but the code provides no prompt, log message, comment, or docstring indicating that it will modify the filesystem. For a code-file review under this rule, file writes should have some visible disclosure unless already documented elsewhere.

Content

No source excerpt is available for this finding.