Back to skill

Security audit

ApiTest

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended to fetch local tool data, but it can automatically send a powerful API token to a localhost service too broadly.

Review this skill before installing. Only use it if you intentionally run and trust the service on localhost:8080, can provide a narrowly scoped API_TEST_KEY, and are comfortable with automatic authenticated requests. Prefer changing the credential to read-only, narrowing triggers to the exact gettool request, and requiring confirmation before sending the token.

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

Warning
Location
SKILL.md:31
Finding
Bearer Token Exposure Through Process Arguments and Plaintext HTTP## Vulnerability Details **File Location**: `SKILL.md:31-35`; duplicated in `README.md:27-30` **Vulnerability Type**: T09: Insecure Skill Coding Practices **Risk Level**: Medium ### Vulnerable Code `SKILL.md:31-35`: ```markdown **Request format**: ```bash curl -H "Authorization: Bearer ${API_TEST_KEY}" http://localhost:8080/gettool ``` ``` `README.md:27-30`: ```markdown ```bash curl -H "Authorization: Bearer ${API_TEST_KEY}" http://localhost:8080/gettool ``` ``` ### Technical Analysis The documented command expands `API_TEST_KEY` directly into the `curl` command-line arguments. Depending on the operating system, process-monitoring permissions, execution wrapper, shell tracing, and audit configuration, the expanded Authorization header may become visible through process inspection, diagnostic output, execution logs, or command auditing. The token is also transmitted over unencrypted HTTP. Although the destination is the loopback interface, HTTP provides no server authentication or transport confidentiality. A malicious or compromised local process that binds to port `8080`, intercepts local traffic, or impersonates the expected service could receive the Bearer token. The associated credential configuration at `SKILL.md:14-17` declares the credential as read-write even though the documented operation is a read-only GET request: ```yaml credentials: primary: API_TEST_KEY scope: read-write description: "用于访问 localhost:8080/gettool 接口的认证密钥" ``` This unnecessarily increases the potential consequences of credential disclosure. ### Attack Path 1. A user request triggers the skill's automatic authenticated request. 2. The shell expands `${API_TEST_KEY}` and places the resulting secret in the `curl` argument containing the Authorization header. 3. A local process with suitable process-inspection, tracing, logging, or audit access observes the expanded argument. Alternatively, an attacker-controlled service listening on `localhost:8080` receives the tok ...[truncated 989 chars]
Remediation
## Remediation Suggestions 1. Avoid placing secrets in process arguments. Use an HTTP client integration that accepts sensitive headers through an in-memory API rather than a shell command. 2. If `curl` must be used, provide sensitive configuration through a protected file descriptor or a temporary configuration file with owner-only permissions, and securely delete the file immediately afterward. Verify that the chosen approach does not expose the token in process listings. 3. Disable shell tracing and ensure execution frameworks, diagnostics, and audit logs redact the `Authorization` header and `API_TEST_KEY`. 4. Use HTTPS with certificate validation for the local API where operationally possible. If HTTP loopback communication is unavoidable, authenticate the local server through a protected IPC mechanism such as a Unix-domain socket with restrictive filesystem permissions. 5. Change the credential from read-write to read-only scope because the documented operation only performs `GET /gettool`. 6. Use a dedicated, short-lived token restricted to the specific endpoint and operation. Rotate the existing token if it may already have appeared in logs or process-monitoring records. 7. Validate that the expected service owns the local endpoint before transmitting credentials, and fail safely if the destination cannot be authenticated. 8. Consider requiring user confirmation before automatically sending an authenticated request, particularly when broad trigger patterns are matched.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Vague Triggers

High
Confidence
95% confidence
Finding
The trigger patterns are broad enough to match common user phrasing such as requesting an API call, localhost access, or tool data, and the skill is configured with auto_invoke=true. This can cause unintended execution against a local service and automatic use of the API_TEST_KEY credential without clear user intent, increasing the risk of unauthorized local resource access and secret-bearing requests.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The README describes automatic calls to a localhost service using an Authorization bearer token from an environment variable, but it does not clearly warn users that the skill will make authenticated local network requests or that local services may expose sensitive data. Even though the destination is localhost rather than an external host, automatic authenticated requests can still access privileged local tooling or agent-side services and may lead to unintended data exposure or side effects.

Natural-Language Policy Violations

Medium
Confidence
85% confidence
Finding
The README specifies trigger phrases and usage instructions only in Chinese, effectively constraining interaction to a specific language with no opt-in or alternative. Under the language/locale policy, this is a natural-language restriction unless the limitation is explicitly justified or the user is given a choice.

Natural-Language Policy Violations

Medium
Confidence
78% confidence
Finding
该技能的自然语言描述与触发说明全部固定为中文,且未说明是否支持用户选择其他语言或按用户语言偏好运行。对于通用技能,这种未提供语言选择的固定语言约束可能构成语言/locale 政策问题。

Vague Triggers

Medium
Confidence
90% confidence
Finding
The prose trigger description is ambiguous and expands activation to vague categories like '其他本地服务器工具获取请求' without clear exclusions. In the context of a skill that performs authenticated requests to localhost, unclear activation boundaries make accidental invocation more likely and can lead to unnecessary access to local services.

Static analysis

No suspicious patterns detected.