Back to skill

Security audit

tsy-gzh-find-topic

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but it sends an API key in a URL to a configurable backend, which should be reviewed before installation.

Install only if you trust the configured backend and understand that the skill will use TSY_API_KEY from .env. Prefer an HTTPS allowlisted BASE_URL, rotate the key if it may have appeared in logs, and consider changing the integration to send credentials in an authorization header instead of the URL.

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
SKILL.md:19
Finding

API Credential Exposed in a Query String and Forwarded to a Configurable Destination

Content
View full analysis
``` The associated configuration instructions obtain `BASE_URL` from the configurable `TSY_API_URL` value and obtain `SATOKEN` from `TSY_API_KEY`. ### Technical Analysis The Skill inserts the sensitive `TSY_API_KEY` value directly into the request URL as the `apikey` query parameter. Query strings are frequently recorded by HTTP clients, reverse proxies, gateways, monitoring platforms, access logs, error reports, and tool execution traces. Consequently, the credential can be exposed even when HTTPS protects the request while it is in transit. The credential's destination is also determined by the configurable `TSY_API_URL` value. The instructions do not require HTTPS, validate the destination origin, or restrict it to the expected `api.tangshiye.cn` host. A malicious or incorrectly configured value can therefore cause the Skill to transmit the API key to an unintended server. Authentication is necessary for the declared API operation, but embedding the credential in a URL and allowing its destination to be changed without validation exceed the minimum safe privileges required. ### Attack Path 1. An attacker, compromised deployment process, or unsafe configuration changes `TSY_API_URL` to an attacker-controlled endpoint. 2. The Skill independently reads the legitimate `TSY_API_KEY` from the global `.env` configuration. 3. It constructs a request to the configured endpoint with the secret embedded in `?apikey={SATOKEN}`. 4. The attacker-controlled server receives and records the API key. 5. Alternatively, without changing the destination, infrastructure that records complete URLs may capture the key from request or error logs ...[truncated 655 chars]
Remediation
View remediation
``` If the backend requires a different header format, use a dedicated secret header rather than a query parameter. 2. Require the destination to use HTTPS and reject plaintext HTTP URLs. 3. Restrict requests to an explicit allowlist containing the expected origin, such as: ```text https://api.tangshiye.cn ``` 4. If custom API origins are a legitimate requirement, require explicit user approval before sending credentials to an origin other than the trusted default. Never automatically forward a production credential across origins. 5. Validate the parsed URL rather than relying on string-prefix checks. Confirm the scheme, normalized hostname, port, and expected path. 6. Ensure that request diagnostics, WebFetch traces, proxy logs, and error messages redact authorization values. 7. Scope the API key to only the `findTopic` operation where supported, apply rate limits, establish expiration and rotation procedures, and revoke any key that may already have appeared in URL logs. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

声明描述的核心能力是调用后端接口并返回推荐结果原始数据,但实际代码只是根据当前上海时区时间计算最近 30 天的起止时间,组装请求参数并打印 JSON。两者的主要目的存在明显差异:实际行为是“构造请求体”,而不是“调用接口并输出结果”。因此描述不能准确代表该代码块的实际行为。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to send a credentialed request to an external backend using an API key sourced from global .env configuration, but provides no user-facing notice that secrets and generated request data will be transmitted off-platform. This creates a risk of unintended credential use and opaque data egress, especially because the skill also mandates raw output handling and discourages analysis or warning behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script fixes its timezone to Asia/Shanghai via a hard-coded locale setting. This can violate language/locale policy expectations because it imposes a regional default without any user opt-in or documented justification in the file.

Content

No source excerpt is available for this finding.