Back to skill

Security audit

企业限制高消费信息查询 - 聚合数据

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Juhe enterprise-restriction lookup skill, but users should handle the API key and legal-query data carefully.

Install only if you are comfortable sending enterprise, applicant, case, and related lookup data to Juhe for paid API queries. Prefer a host-managed environment variable for the API key, avoid passing the key on the command line, and do not store scripts/.env in a shared or version-controlled directory.

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/enterprise_restriction.py:255
Finding
API Credential Exposure Through Command-Line Arguments and Insecure Plaintext Storage<![CDATA[ ## Vulnerability Details **File Location**: `scripts/enterprise_restriction.py:70-77, 255-257`; insecure usage is also documented in `SKILL.md:29-33` **Vulnerability Type**: API credential exposure **Risk Level**: Medium ### Vulnerable Code The script accepts the API key directly from command-line arguments: ```python if args[i] == "--key" and i + 1 < len(args): cli_key = args[i + 1] i += 2 ``` It also reads the credential from a plaintext `.env` file without verifying its ownership or permissions: ```python env_file = Path(__file__).parent / ".env" if env_file.exists(): for line in env_file.read_text(encoding="utf-8").splitlines(): line = line.strip() if line.startswith("JUHE_ENTERPRISE_RESTRICTION_KEY="): val = line.split("=", 1)[1].strip().strip('"').strip("'") if val: return val ``` ### Technical Analysis Passing credentials through command-line arguments is insecure because arguments may be exposed through: - Process inspection utilities while the script is running. - Shell history files. - Terminal session recording. - CI/CD job logs and command tracing. - Endpoint monitoring and process telemetry. The alternative `.env` mechanism stores the API key in plaintext beside the script. The implementation neither enforces restrictive permissions nor checks whether the file is owned by the expected user. Depending on the system umask, the file may be readable by other local users. It may also be accidentally committed or included in archives because the reviewed project does not provide a corresponding ignore rule. The key is legitimately transmitted to the documented Juhe HTTPS endpoint as part of the declared lookup operation. No evidence indicates that it is printed in query results or sent to an unrelated destination. The issue concerns local credential handling rather than hidden network exfiltration. ### Attack Path 1. A user follows the documented usage and supplies ...[truncated 1263 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--key` command-line option and all documentation encouraging credentials in command arguments. 2. Prefer the existing environment-variable mechanism or an operating-system credential store. 3. If `.env` support must remain: - Require file permissions equivalent to owner read/write only. - Verify file ownership before reading it. - Reject or warn about group-readable or world-readable permissions. - Add `scripts/.env` and general secret-file patterns to `.gitignore`. - Document secure creation using a restrictive umask. 4. Avoid exposing the credential in logs, exceptions, diagnostics, or serialized output. 5. Recommend immediate key rotation if a key has previously been supplied through command-line arguments or committed to source control. 6. Limit the API key at the provider level where supported, including quota limits, endpoint restrictions, monitoring, and billing alerts. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding
The skill documentation indicates capabilities to read environment variables, read local files, and make network requests, but it does not declare corresponding permissions. This creates a transparency and governance gap: a host system or user may not realize the skill can access secrets and transmit queried data to an external API, increasing the risk of unintended data exposure.

Vague Triggers

Medium
Confidence
86% confidence
Finding
The trigger phrases include broad natural-language terms such as '限高', '这家公司被限高了吗', and '查一下限高记录', which can overlap with ordinary conversation and cause accidental activation. Unintended invocation is risky here because the skill sends enterprise and possibly person-related legal/query data to a third-party service that charges per request.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The description explains the business purpose but does not warn that submitted company names, applicant names, case numbers, or related identifiers are transmitted to juhe.cn for lookup. Because the queried content concerns legal restrictions and associated persons, the absence of a disclosure meaningfully increases privacy and compliance risk.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The script transmits enterprise names, applicant names, case numbers, and related query metadata to a third-party API service. Even if this is the intended functionality, users are not explicitly warned at execution time that their inputs are being sent off-host, which can create privacy, compliance, and data-handling risks for sensitive legal or business queries.

Credential Access

High
Category
Privilege Escalation
Content
# 方式一:环境变量(推荐,一次配置永久生效)
export JUHE_ENTERPRISE_RESTRICTION_KEY=你的 AppKey

# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_ENTERPRISE_RESTRICTION_KEY=你的 AppKey" > scripts/.env

# 方式三:每次命令行传入
Confidence
88% confidence
Finding
The skill recommends storing the API key in a local `scripts/.env` file and also supports passing the key directly on the command line. Both patterns increase secret exposure risk: `.env` files may be accidentally committed or read by other tooling, and command-line arguments can be exposed via shell history or process listings.

Credential Access

High
Category
Privilege Escalation
Content
export JUHE_ENTERPRISE_RESTRICTION_KEY=你的 AppKey

# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_ENTERPRISE_RESTRICTION_KEY=你的 AppKey" > scripts/.env

# 方式三:每次命令行传入
python scripts/enterprise_restriction.py --key 你的 AppKey --name 山西尧信融资再担保有限公司
Confidence
96% confidence
Finding
The documentation explicitly instructs users to create `scripts/.env` containing the API key and nearby also shows a `--key` command-line example. This is dangerous because it normalizes insecure secret handling practices that can leak credentials through source control, backups, logs, terminal history, or process inspection.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/enterprise_restriction.py:16