Back to skill

Security audit

ais-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for remote knowledge-base work, but it handles raw authentication tokens and local file transfers in ways that need careful review before use.

Install only if you trust the TorchV AIS endpoint and are comfortable giving the skill KB access. Prefer a scoped, short-lived token stored outside command-line arguments, avoid copying broad browser session tokens, keep KB_EXECUTE_URL fixed to the intended HTTPS service, and be cautious with upload/download and --overwrite operations.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/kb_execute.py:58
Finding

Credentials and sensitive content can be transmitted to an unrestricted or plaintext destination

Content
View full analysis
str: parsed = urllib.parse.urlparse(raw_url) if not parsed.scheme or not parsed.netloc: raise ValueError(f"invalid KB execute URL: {raw_url!r}") if parsed.path == EXECUTE_PATH: return urllib.parse.urlunparse(parsed) if parsed.path in ("", "/"): return urllib.parse.urlunparse(parsed._replace(path=EXECUTE_PATH, params="", query="", fragment="")) return urllib.parse.urlunparse(parsed) ``` ```python parser.add_argument( "--url", default=os.environ.get("KB_EXECUTE_URL"), help="AIS site URL or full KB execute endpoint. Defaults to env KB_EXECUTE_URL.", ) parser.add_argument( "--token", default=os.environ.get("KB_TOKEN"), help="KB token header value. Defaults to env KB_TOKEN.", ) ``` ```python headers = {"Content-Type": "application/json", **build_auth_headers(args.token), **headers} payload = json.dumps({"command": command}, ensure_ascii=False).encode("utf-8") request = urllib.request.Request( url=args.url, data=payload, headers=headers, method="POST", ) return send_request(request, args.timeout) ``` The same destination is also used by the upload and download operations, which attach authentication headers through `build_auth_headers(token)`. ### Technical Analysis The URL validation only requires a parsed scheme and network location. It does not require HTTPS, constrain the hostname to a trusted KB service, reject embedded URL credentials, or otherwise establish that the destination is authorized to receive the KB token and payload. Consequently, a value such as `http://attacker.example` is accepted. The script then sends an authentication token together with KB ...[truncated 1654 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/kb_execute.py:221
Finding

Server-controlled download filename permits directory traversal and arbitrary file placement

Content
View full analysis
str: target_path = local_path if os.path.isdir(local_path): target_path = os.path.join(local_path, extract_download_name(content_disposition) or code) if not overwrite and os.path.exists(target_path): raise FileExistsError(target_path) return target_path def extract_download_name(content_disposition: str | None) -> str | None: if not content_disposition: return None import re from urllib.parse import unquote utf8_match = re.search(r"filename\\*=UTF-8''([^;]+)", content_disposition, re.IGNORECASE) if utf8_match: return unquote(utf8_match.group(1)) quoted_match = re.search(r'filename="([^"]+)"', content_disposition, re.IGNORECASE) if quoted_match: return quoted_match.group(1) plain_match = re.search(r"filename=([^;]+)", content_disposition, re.IGNORECASE) if plain_match: return plain_match.group(1).strip() return None ``` ### Technical Analysis When `--save-to` names an existing directory, the response’s `Content-Disposition` filename is joined directly to that directory. The extracted filename is not reduced to a safe basename and is not checked for absolute paths, parent-directory components, platform-specific separators, or canonical containment. A malicious filename such as `../../outside.txt` can therefore escape the selected ...[truncated 1922 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:32
Finding

Documentation encourages passing KB authentication tokens through command-line arguments

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

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to obtain and use a user's authentication token copied from browser developer tools, which is a direct credential-handling anti-pattern. In this context the risk is elevated because the token is then used for remote KB operations over the network, potentially granting the agent broad persistent access to user data and administrative actions.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/write.md (reported line 109)May include surrounding context.

md
用于删除文档或空目录。只有用户明确要求时才使用。

- 常用写法:
  - `kb rm <repo/path.md>`
  - `kb rm --doc-code <code>`
- 使用要求:
  - 删除是高风险操作,必须确认目标无误。

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes sensitive capabilities including environment-variable access, local file handling, and outbound network requests, yet it declares no explicit tool scope or permission boundaries. That omission increases the chance an agent can use broader-than-necessary capabilities without clear review, especially because the skill is designed to send commands and credentials to a remote execution service.

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 content is entirely written as mandatory Chinese-language operating instructions and does not indicate that the user may choose another language. Under the stated policy, forcing a specific language or locale without opt-in is a natural-language policy violation unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation tells users to extract a live authentication token from browser developer tools and provide it to the agent, but gives no meaningful warning about the sensitivity of that credential or the risks of sharing it. This exposes reusable session or API credentials to the model and any connected tooling, enabling unauthorized KB access if the token is logged, retained, or misused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document exposes capabilities to upload local files, download remote content to real local filesystem paths, and generate wget-accessible temporary links, but it does not include clear safety constraints, user-consent requirements, or privacy warnings. In an agent skill context, this increases the risk of unintended data exfiltration, overwriting local files, or creating externally accessible links to sensitive knowledge-base content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code exposes operations that upload local files to a remote AIS service and download remote files to the local filesystem, including optional overwrite behavior. Although the CLI help names the operations, there is no explicit warning, confirmation, or safety disclosure about transmitting file contents off-machine or writing/overwriting local files.

Content

No source excerpt is available for this finding.