Back to skill

Security audit

企业被执行人信息查询(公示中及历史) - 聚合数据

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Juhe enterprise legal-record lookup skill, but it needs Review because it encourages risky API-key handling for a paid sensitive-data service.

Install only if you are comfortable sending company names, case filters, and your Juhe API key to Juhe for billable lookups. Prefer platform-managed secrets or an environment variable, avoid scripts/.env and --key usage, never put the key in a URL, and confirm the exact company before running a query.

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_executed.py:286
Finding
API Credential Exposure Through Command-Line Arguments and URL Examples## Vulnerability Details **File Location**: `scripts/enterprise_executed.py:70-71`, `scripts/enterprise_executed.py:286-288`; related insecure usage guidance at `SKILL.md:25-34` and `SKILL.md:76-78` **Vulnerability Type**: API credential exposure **Risk Level**: Medium ### Vulnerable Code and Documentation The script accepts the API key directly from a command-line argument: ```python def load_api_key(cli_key: str = None) -> str: if cli_key: return cli_key ``` The command-line parser obtains the credential from the process argument list: ```python if args[i] == "--key" and i + 1 < len(args): cli_key = args[i + 1] i += 2 ``` The documentation explicitly recommends this usage: ```bash python scripts/enterprise_executed.py --key 你的 AppKey --name 河北展发房地产开发有限公司 ``` It also demonstrates placing the API key in a URL query string: ```text GET https://apis.juhe.cn/api_credit/query842?key=YOUR_KEY&name=河北展发房地产开发有限公司&nametype=1&pageIndex=1&pageSize=20&isNeedHisData=true ``` ### Technical Analysis Secrets supplied through command-line arguments can be retained in shell history and may be visible through process-inspection facilities, diagnostic tooling, audit systems, or telemetry collectors. This unnecessarily broadens credential exposure beyond the querying process. Embedding an API key in a URL is also unsafe because query strings may be recorded in browser history, proxy logs, reverse-proxy access logs, monitoring platforms, and other HTTP infrastructure. Although the script itself sends the key to the declared Juhe endpoint using HTTPS and a POST form body, the documented GET example creates a separate credential-disclosure risk. Network transmission to `https://apis.juhe.cn/api_credit/query842` is necessary for the Skill's declared third-party enterprise-record lookup. No undeclared exfiltration endpoint was identified. The weakness is therefore in credentia ...[truncated 1428 chars]
Remediation
## Remediation Suggestions 1. Remove the `--key` command-line option so credentials cannot be supplied through the process argument list. 2. Remove all examples that place API keys in URLs or command-line arguments. 3. Prefer the existing `JUHE_ENTERPRISE_EXECUTED_KEY` environment variable mechanism, while documenting that secrets should be injected by a trusted secret manager rather than committed to shell startup files. 4. If `.env` support remains available: - Require restrictive file permissions such as `0600`. - Add `scripts/.env` and general `.env` patterns to `.gitignore`. - Refuse to load files that are group- or world-readable where supported. - Warn users never to commit the file to source control. 5. For interactive use, optionally accept the key with a hidden prompt such as Python's `getpass.getpass()` when no secure environment-based credential is available. 6. Continue transmitting the key only to the fixed HTTPS endpoint using the POST request body. 7. Avoid including credentials in exceptions, debugging output, request logs, or formatted results. 8. Rotate any API key that has previously been used in command-line or URL examples and review Juhe usage records for unauthorized requests.
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 (7)

Lp3

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding
The skill declares runtime requirements for environment variables and uses file/network capabilities, but does not expose an explicit permissions model or user-facing consent boundary for accessing secrets and making external requests. This can lead to unexpected secret usage and outbound data transmission, especially in agent ecosystems that rely on declarative permissions for safe execution.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The trigger phrases are broad and include common terms like “被执行人” and “被执行,” which may cause the skill to activate for loosely related conversation rather than an intentional records lookup. Unintended activation is risky here because the skill performs paid external queries and may retrieve sensitive legal or identity-related data.

Vague Triggers

Medium
Confidence
86% confidence
Finding
The AI usage guidance says to act 'when the user needs to query enterprise executed-person information' without defining strict scope boundaries or confirmation requirements. In practice, this ambiguous activation condition can cause the agent to initiate a sensitive legal-data lookup too readily, increasing privacy and cost exposure.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill processes and may return sensitive identifiers, including organization codes, unified social credit codes, and potentially ID card numbers, yet the description lacks a prominent privacy warning and handling policy. Even though masking is mentioned later, the absence of an upfront privacy disclosure increases the chance of inappropriate collection, display, or user surprise.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The script sends user-supplied enterprise identifiers, case filters, and the API key to a third-party service over the network, but does not present an explicit runtime warning or consent step before transmitting potentially sensitive query data externally. In this skill context, users may input company names, credit codes, registration numbers, or case-related data that can be commercially sensitive, so silent exfiltration to an external provider is a real privacy and data-governance risk even though HTTPS is used.

Credential Access

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

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

# 方式三:每次命令行传入
Confidence
93% confidence
Finding
The documentation instructs users to write the API key into `scripts/.env`, creating a plaintext credential file inside the project tree. Secrets stored this way are commonly exposed through accidental commits, logs, backups, or broader file-read permissions available to other tools and agents.

Credential Access

High
Category
Privilege Escalation
Content
export JUHE_ENTERPRISE_EXECUTED_KEY=你的 AppKey

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

# 方式三:每次命令行传入
python scripts/enterprise_executed.py --key 你的 AppKey --name 河北展发房地产开发有限公司
Confidence
95% confidence
Finding
The example `echo "JUHE_ENTERPRISE_EXECUTED_KEY=你的 AppKey" > scripts/.env` operationalizes insecure secret storage by placing the API key in a predictable plaintext location. In the context of an agent skill with file-read capability, this increases the risk that the credential is later discovered or exfiltrated by other components or through repository leakage.

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_executed.py:16