Back to skill

Security audit

Init Workspace

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for provisioning Gitea-backed knowledge workspaces, but it uses broad admin authority and an unsafe HTTP default that require careful review before installation.

Install only if you control the target Gitea instance and can replace the default URL with HTTPS, use the narrowest possible service token, restrict who can invoke these scripts, and accept that the skill will create and modify private repositories, control-plane JSON files, and collaborator permissions. Pin dependencies before deployment and rotate any admin token that may have been used with the HTTP endpoint.

Vulnerability Patterns
  • 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
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/gitea_api.py:38
Finding

Site-Administrator Token Is 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 configuration specifies a public IP address using unencrypted HTTP. `setup.sh` copies this example into `.env` when no configuration exists, and every Gitea API request places `GITEA_ADMIN_TOKEN` in the `Authorization` header. HTTP provides neither transport confidentiality nor server authentication. An attacker positioned on the client network, gateway, hosting network, or another part of the routing path can inspect the bearer token. An active man-in-the-middle attacker can also modify requests and responses. Because the credential is a bearer token, possession is sufficient for reuse; the attacker does not need the administrator's password. ### Attack Path 1. An operator runs `setup.sh`, which copies `env-example.txt` to `.env`. 2. The operator supplies a site-administrator token but leaves the example HTTP endpoint unchanged. 3. Any initialization or repository-management command invokes `gitea_api.api()`. 4. The token is transmitted in an HTTP `Authorization` header. 5. A network-path attacker captures the request. 6. The attacker reuses the token against the Gitea API to perform administrator-authorized o ...[truncated 358 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/gitea_api.py:110
Finding

Routine Workspace Operations Execute With Excessive Site-Wide Privilege

Content
View full analysis
bool: try: api("GET", "/admin/users", params={"limit": 1}) return True except GiteaError: return False ``` ```python # scripts/gitea_api.py:110-130 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}")} def create_bot_repo(name: str, description: str, private: bool = True) -> dict: if repo_exists(BOT_USERNAME, name): return {"created": False, "html_url": f"{GITEA_URL}/{BOT_USERNAME}/{name}"} data = api("POST", "/user/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}/{BOT_USERNAME}/{name}")} def add_collaborator(owner: str, repo: str, username: str, permission: str) -> None: api("PUT", f"/repos/{owner}/{repo}/collaborators/{username}", json_body={"permission": permission}, ok=(204, 201, 200)) ``` ```p ...[truncated 1899 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/bind_chat.py:19
Finding

Privileged Operations Trust Caller-Supplied Identity Without Cryptographic Authentication

Content
View full analysis
str: return args.sender_id or args.open_id ``` ```python # scripts/bind_chat.py:41-52 def get_actor_team(sender_id: str) -> tuple[dict | None, str, dict | None, dict | None]: users = sc.users() user = users.get(sender_id) if not user: return None, "", None, json_fail("user_not_registered", "请先私聊我完成个人知识库初始化。") team_id = user.get("team_id", "") if not team_id: return user, "", None, json_fail("user_not_in_team", "你还没有加入团队,不能绑定团队群。") team = sc.teams().get(team_id) if not team: return user, team_id, None, json_fail("team_not_found", "system-config 中找不到你的团队。") if sender_id not in team.get("admins", []): return user, team_id, team, json_fail("not_team_admin", "只有团队管理员可以绑定或解绑团队群。") return user, team_id, team, None ``` ```python # scripts/create_project.py:40-62 parser.add_argument("--open_id", required=True) parser.add_argument("--project_name", required=True) parser.add_argument("--brief", default="") parser.add_argument("--project_id", default="") args = parser.parse_args() sc.ensure_system_repo() users = sc.users() user = users.get(args.open_id) if not user: out(json_fail("user_not_registered", "请先完成个人知识库初始化。")) return team_id = user.get("team_id", "") if not team_id: out(json_fail("not_in_team", "当前用户还没有加入团队,不能创建团队项目。")) return teams = sc.teams() team = teams.get(team_id) if not team: out(json_fail("team_not_found", "system-config 中找不到该团队。")) return if args.open_id not in team.get("admins", []): out(json_fail("permi ...[truncated 2806 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned Third-Party Dependencies Are Installed 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 (43)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented repair workflow says provisioning recovery may perform direct mutation of JSON files based on recorded operations. If the recovery record is tampered with, a repair tool that trusts those records could overwrite unintended control-plane files or corrupt authorization state, creating a risky data-integrity primitive in a highly privileged repository context.

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

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

The skill instructs the agent to access environment-derived configuration such as GITEA_URL and to invoke scripts that clearly require network and local state access, but it declares no explicit tool scope or allowed-tools boundary. Missing capability scoping increases the chance that an agent runtime grants broader-than-necessary access, making sensitive operations against Gitea and control-plane files harder to constrain or audit.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The provided skill manifest context says this skill initializes knowledge bases, teams, project spaces, Gitea permissions, and a control repository. In the code, the exported description is only "paper-kb v3 skill: init_workspace," which does not reflect that broader operational scope and therefore mismatches the stated behavior description for the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code defines multiple user-facing card titles, summaries, labels, and action text entirely in Chinese, including registration, team creation, and confirmation flows. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The function writes to catalog.json via g.put_file, which modifies repository content, but there is no confirmation prompt, visible user-facing log, or warning in the code around this operation. Because this is a state-changing file write, users may not be explicitly informed when the repository is updated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This call writes index.md back to the repository, replacing generated content, yet the code provides no confirmation prompt or visible disclosure to the user. Regenerating and overwriting repository files is a safety-relevant operation that should be made explicit.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This script creates project files in a repository via ensure_project_files, updates the catalog, regenerates an index, and mutates teams.json, all of which are persistent write operations. The file contains no confirmation prompt, warning print/log, or explanatory docstring/comment disclosing these side effects before they occur.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill's purpose includes configuring Gitea repositories and maintaining a control repository, so networked Gitea API access is expected. However, this helper explicitly consumes an admin token and is later used for site-admin endpoints such as creating repositories under arbitrary users and probing /admin/users, which is a broader privileged capability than a typical per-workspace repository helper needs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The module reads a sensitive credential from GITEA_ADMIN_TOKEN and automatically sends it in Authorization headers on outbound HTTP requests. There is no user-facing notice, comment, or docstring explaining that the skill consumes admin credentials and transmits authenticated requests to the configured Gitea server.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This function can create repositories for arbitrary users through the Gitea admin endpoint, which is broader than typical workspace initialization needs and could be abused if exposed through higher-level agent actions without strict authorization checks. In an agent skill context, this is more dangerous because natural-language-triggered automation may let a user indirectly invoke powerful admin-side effects across other users' namespaces.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code performs safety-relevant remote write operations against Gitea, including creating repositories, adding collaborators, and creating or updating repository contents. The file contains no confirmation prompt, print/log disclosure, or inline comment/docstring warning users that these actions will modify remote repositories under an admin or bot context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script creates a private repository and writes multiple files to it via Gitea API calls, which are safety-relevant persistent changes. In this file there is no confirmation prompt, logging/print disclosure before the action, or comment/docstring warning the user that a new repo and initial contents will be created remotely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The code grants write access on the newly created repository to the user's Gitea account, which changes permissions on a remote resource. Although this may be part of the workflow, this file contains no visible prompt, disclosure, or explanatory comment informing the user that repository permissions will be modified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The registration flow creates a private Gitea repository and then writes persistent records to users.json and related state files. While the script returns result JSON after the fact, there is no confirmation prompt, user-facing disclosure, or explanatory comment/docstring in this file before these safety-relevant write operations occur.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script grants Gitea repository access before persisting the user's team membership in local state. If the later JSON updates fail, the user can retain repository read access even though the system does not record them as a team member, creating an authorization/state mismatch that can be abused or become difficult to detect and remediate. In this skill context, which manages team creation and repository permissions, that inconsistency directly affects access control and is therefore more security-relevant than a generic ordering bug.

Content

No source excerpt is available for this finding.