Back to skill

Security audit

论文去AI味(最佳)

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Chinese text-rewriting API client, but it needs review because it can send the API key and submitted content to an environment-selected server without validating the destination.

Install only if you trust the AI Skills service and control the runner environment. Keep AISKILLS_BASE_URL pinned to the intended HTTPS service, treat AISKILLS_API_KEY as sensitive, and avoid submitting confidential, regulated, or unpublished material unless the provider's data handling is approved for that content. Consider disabling implicit invocation if you want the skill to run only on explicit requests.

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/run.py:20
Finding
Unrestricted API Base URL Allows Credential and User-Content Disclosure<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run.py`, lines 20–35 and 79–86 **Vulnerability Type**: Unvalidated destination URL for authenticated API requests **Risk Level**: High ### Vulnerable Code ```python def build_base_url(): return os.getenv("AISKILLS_BASE_URL", DEFAULT_BASE_URL).rstrip("/") def build_headers(): api_key = os.getenv("AISKILLS_API_KEY", "").strip() tenant_id = os.getenv("AISKILLS_TENANT_ID", "default").strip() or "default" if not api_key: fail("AISKILLS_API_KEY is required") return { "Content-Type": "application/json", # Cloudflare blocks urllib's default Python user agent for this endpoint. "User-Agent": "ai-skills-runner/1.0 (+https://ai-skills.ai)", "Accept": "application/json", "X-API-Key": api_key, "X-Tenant-Id": tenant_id, } ``` ```python def request_json(method, path, payload): body = json.dumps(payload).encode("utf-8") req = urllib.request.Request( f"{build_base_url()}{path}", data=body, method=method, headers=build_headers(), ) try: with urllib.request.urlopen(req, context=SSL_CONTEXT) as response: return json.loads(response.read().decode("utf-8")) ``` The initial execution request also places all supplied user parameters into the request body: ```python response = request_json("POST", EXECUTE_PATH, {"skillId": SKILL_ID, "params": params}) ``` ### Technical Analysis The destination of authenticated API requests is controlled directly through the `AISKILLS_BASE_URL` environment variable. The value is only processed with `rstrip("/")`; the code does not validate its scheme, hostname, port, embedded credentials, or trust relationship. `request_json()` sends the following sensitive information to the resulting destination: - The `AISKILLS_API_KEY` credential in the `X-API-Key` header. - The tenant identifier in the `X-Tenant-Id` header. - Complete user parameter ...[truncated 2511 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Require HTTPS** - Parse the configured URL with `urllib.parse.urlsplit()`. - Reject every scheme except `https`. - Reject URLs containing embedded usernames or passwords. 2. **Allowlist trusted destinations** - Prefer a fixed production endpoint rather than an environment-controlled base URL. - If endpoint customization is required, compare the normalized hostname and port against an explicit allowlist. - Do not rely on suffix matching such as `hostname.endswith("ai-skills.ai")`, which can accept attacker-controlled names. 3. **Prevent credential forwarding** - Only add `X-API-Key` and `X-Tenant-Id` after confirming that the final destination is trusted. - Use separate, limited credentials for explicitly supported non-production endpoints. - Ensure production credentials are never sent to arbitrary development or testing servers. 4. **Restrict redirects** - Prevent automatic redirects to untrusted hosts, or validate the scheme, hostname, and port of every redirect target before forwarding sensitive headers or request bodies. - Strip authentication and tenant headers whenever a redirect changes origin. 5. **Apply least privilege** - Scope API keys to the required skill and operations where supported. - Apply tenant restrictions, expiration, usage quotas, and credential rotation. - Rotate any credential that may already have been used while an untrusted base URL was configured. 6. **Fail closed** - Terminate execution with a clear error when the configured URL is malformed, uses plaintext HTTP, specifies an unexpected port, or does not match the trusted endpoint policy. - Add automated tests covering malicious hosts, plaintext URLs, embedded credentials, malformed URLs, and cross-origin redirects. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill requires an API key and documents calling an external API, but it does not declare any explicit tool scope or allowed-tools policy despite using environment access and network capabilities. This weakens least-privilege controls and makes it harder for a host platform to constrain what the skill may access or transmit, increasing the chance of unintended secret exposure or uncontrolled outbound requests.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The description repeatedly states the skill is for rewriting Chinese content and naturalizing Chinese text, which imposes a language constraint in the natural-language documentation. There is no indication that users can choose another language or explicitly opt into this locale limitation.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The documentation instructs users to submit text, files, and publicly accessible URLs to an external API but does not clearly warn that this content leaves the local environment. In a skill designed to process drafts, papers, marketing copy, and linked documents, users may unknowingly send sensitive or proprietary content to a third party, creating privacy, confidentiality, and compliance risk.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The display name, description, and referenced prompt are all Chinese-specific, including a prompt name ending in '-zh', which indicates a language-specific behavior. The file does not offer a language choice or document that this locale restriction is optional or justified.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The skill enables implicit invocation without any visible trigger constraints, which can cause it to activate in situations the user did not clearly request. Because this skill rewrites text to remove 'AI flavor,' unintended activation could silently alter user content, undermine transparency, or assist concealment-oriented use cases without explicit consent.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The placeholder explicitly instructs users to paste Chinese text, and multiple field descriptions and platform labels consistently constrain the skill to Chinese output/use. Because this locale requirement is embedded in the schema without offering a language choice or documenting a region-specific justification, it fits the natural-language policy violation for forced language/locale.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
This description tells users to paste Chinese content specifically, reinforcing a mandatory Chinese-only workflow. There is no adjacent opt-in, alternative locale support, or documented justification for the restriction, so it represents a language-policy concern under the file-wide natural-language guidance.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The skill name and surrounding descriptions consistently define the tool as operating on Chinese text only, e.g. "去AI味助手" and later references to "中文文本" and "中文内容". This imposes a language constraint without offering user opt-in or documenting a region-specific/compliance reason for the restriction, which matches the language/locale policy violation criteria.

Context-Inappropriate Capability

Medium
Confidence
84% confidence
Finding
For a skill described as helping rewrite text to reduce 'AI tone,' the code's dependence on environment-provided API keys and tenant identifiers introduces credential handling and multi-tenant service access capabilities unrelated to the user-facing purpose. This is not inherently malicious, but it is an infrastructure capability that the manifest does not justify or disclose.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The billing-insufficient error returned to users is hardcoded in Chinese, which forces a specific language regardless of user preference or locale. This is a natural-language policy concern because the file provides no opt-in, fallback, or documented justification for the locale restriction.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The runner transmits user-provided params and execution metadata to a remote service at ai-skills.ai, which creates a real data exposure boundary not evident from the skill’s local text-assistant description alone. Even if this is the intended backend architecture, sending potentially sensitive user text off-host without explicit disclosure or consent is a security/privacy risk.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The code sends user-supplied params together with tenant metadata to a remote endpoint, but this file provides no user-facing disclosure or mechanism to restrict sensitive content from being transmitted. For a rewriting/humanization skill, users may paste proprietary drafts, internal documents, or personal data, making silent exfiltration to a third-party service materially risky.

Static analysis

No suspicious patterns detected.