Back to skill

Security audit

睿查得-企业信息查询

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to perform the advertised company-information lookup, but it handles API keys in an exposed way and sends business queries to an external service.

Review this skill before installing. Use a disposable or tightly scoped API key, avoid placing real keys in command lines or chat transcripts, rotate any key already used that way, and be aware that company names, categories, and returned records are sent to and received from the external enterprise-data provider.

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
scripts/query.py:68
Finding
API Key Exposed Through Command-Line Arguments## Vulnerability Details **File Location**: `scripts/query.py:68-75` **Secondary Locations**: `SKILL.md:27-28`, `SKILL.md:124-125` **Vulnerability Type**: Command-line secret exposure **Risk Level**: Medium ### Vulnerable Code ```python def main(): parser = argparse.ArgumentParser(description="企业信息查询") parser.add_argument("--keyword", required=True, help="企业名称关键词(必填)") parser.add_argument("--category", help="企业分类(可选)") parser.add_argument("--API_KEY", required=True, help="API密钥(必填)") args = parser.parse_args() ``` The documented invocation explicitly places the credential in the command line: ```text python scripts/query.py --keyword "南京水利公司" --category "01" --API_KEY "ABC123" ``` ### Technical Analysis The script requires the service API key to be supplied through the `--API_KEY` command-line argument. Command-line arguments are not an appropriate secret-delivery mechanism because they may be: - Recorded in interactive shell history. - Captured by process monitoring, audit, observability, or endpoint-management systems. - Visible through process inspection facilities to users with sufficient local permissions. - Retained in automation logs, job metadata, terminal transcripts, or support diagnostics. The key is subsequently included in the JSON body of an HTTPS request to the fixed endpoint `https://rcd-test.dfwycredit.com/s1/skill/enterprise`. Transmission to that service is declared and necessary for authentication, and HTTPS protects the request in transit under normal certificate-validation assumptions. The confirmed weakness is therefore the local handling of the credential through process arguments, not the declared network transmission itself. ### Attack Path 1. A consumer follows the documented example and invokes the script with a real API key in `--API_KEY`. 2. The full command is retained in shell history, automation output, process telemetry, or another local com ...[truncated 1087 chars]
Remediation
## Remediation Suggestions 1. Remove the `--API_KEY` command-line argument and obtain the credential from a protected secret source, such as: - A secret manager supplied by the execution platform. - A restricted-permission configuration or credential file. - A dedicated environment variable where platform constraints require it. - Standard input through a non-echoing prompt for interactive use. 2. For environment-based configuration, fail safely when the variable is absent: ```python API_KEY = os.environ.get("RCD_API_KEY") if not API_KEY: parser.error("RCD_API_KEY is not configured") ``` 3. Update `SKILL.md` to remove every command example containing an API key. Document secure configuration separately, for example: ```text RCD_API_KEY is supplied through the platform's secret configuration. python scripts/query.py --keyword "Example Company" --category "01" ``` 4. Ensure the key is never included in logs, exceptions, telemetry, debug output, or returned JSON. Apply explicit redaction if request parameters are logged by surrounding infrastructure. 5. Restrict each API key to the minimum required operations, enforce rate limits, monitor anomalous use, and provide straightforward revocation and rotation procedures. 6. Treat keys previously used through the documented command-line interface as potentially exposed and rotate them where shell history, process telemetry, or automation logs may have retained the command.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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)

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill invokes a networked Python script and transmits user-supplied parameters, including an API key, to an external service, but it does not declare any explicit tool scope or permission boundary. This weakens reviewability and consent because consumers cannot easily see that external network access is required before the skill runs.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill asks users to provide an API key and company query terms that are then sent directly to a third-party enterprise data provider, but it does not warn users about that transmission. This creates a transparency and privacy risk, especially where company names, search targets, or credentials may be sensitive in a business context.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill requires raw passthrough of external JSON responses without any filtering, summarization, or sensitivity checks. Because the returned enterprise data may include personal names, legal representatives, shareholders, or other sensitive records, blindly reflecting the payload can expose unnecessary personal or regulated information and can also surface untrusted content directly to the user.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The entire document, including headings, instructions, examples, and usage guidance, is written in Chinese and presents the skill workflow only in that language. This creates a natural-language locale constraint without any opt-in, alternative language option, or explicit justification that the skill is intended only for Chinese-language or China-specific use.

External Transmission

Medium
Category
Data Exfiltration
Content
params["category"] = category

    try:
        response = requests.post(API_URL, json=params, timeout=10)
        response.raise_for_status()

        # 尝试解析 JSON 响应
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script accepts the API key as a command-line argument, which can expose the secret through shell history, process listings, job control logs, and orchestration metadata. It then transmits that key to a remote service in the request body; although the URL uses HTTPS, the local exposure risk remains and there is no warning or safer handling path for credentials.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The skill description, trigger conditions, setup instructions, and examples are entirely in Chinese, including required invocation phrases for obtaining and setting the API key. There is no indication that users may choose another language or that the Chinese-only constraint is a documented regional requirement.

Static analysis

No suspicious patterns detected.