Back to skill

Security audit

企业工商信息列表查询 - 聚合数据

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it queries Juhe's enterprise-information API, but users should handle the API key carefully because the docs allow less-safe command-line and URL examples.

Install only if you are comfortable sending enterprise search terms and your Juhe API key to Juhe's API. Prefer the JUHE_ENTERPRISE_LIST_KEY environment variable over --key or URL query examples, avoid entering sensitive identifiers unless the lookup is intentional, and expect usage to consume paid or quota-limited API calls.

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_list.py:155
Finding

API Key Exposure Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/enterprise_list.py:155-157
Additional Locations: SKILL.md:32-33, scripts/enterprise_list.py:10-13, scripts/enterprise_list.py:172-173
Vulnerability Type: Credential exposure through process arguments and command history
Risk Level: Medium

The Skill explicitly supports passing the Juhe API key through the --key command-line option. The vulnerable argument-processing code is:

python
if args[i] == "--key" and i + 1 < len(args):
    cli_key = args[i + 1]
    i += 2

The usage instructions also advertise this method:

bash
python scripts/enterprise_list.py --key 你的 AppKey --keyword 天聚地合

Technical Analysis

Command-line arguments are not an appropriate secret transport mechanism. Depending on the host and execution environment, arguments can be exposed through:

  • Shell history files
  • Process inspection utilities and operating-system process metadata
  • Audit and endpoint-monitoring logs
  • CI/CD job output and automation logs
  • Terminal recording or support-session capture

The key is legitimately transmitted over HTTPS to the fixed, documented Juhe endpoint, and no unrelated data exfiltration was identified. The vulnerability concerns local credential handling before the network request rather than the necessity or destination of that request.

Attack Path

  1. A user follows the documented example and invokes the script with --key.
  2. The shell records the complete command in its history, or process/audit tooling captures the argument list.
  3. Another local user, administrator, monitoring-system operator, or party with access to retained logs reads the API key.
  4. The party reuses the exposed key to make unauthorized requests to the Juhe API.
  5. The unauthorized requests consume the victim's quota and may generate charges or interfere with legitimate service availability.

Impact Assessment

Successf ...[truncated 514 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove or deprecate the --key command-line option so credentials are not accepted through process arguments.
  2. Prefer the existing JUHE_ENTERPRISE_LIST_KEY environment variable or integration with a platform secret manager.
  3. If file-based configuration remains supported, require a dedicated secret file with restrictive permissions, such as mode 0600, and ensure .env is excluded from version control.
  4. For interactive use, obtain the key with getpass.getpass() so it is not echoed or recorded in command history.
  5. Update SKILL.md, the module docstring, help output, and examples to remove commands containing keys.
  6. Warn existing users to inspect shell histories and automation logs and rotate any key previously supplied through --key.
  7. Avoid printing the key in errors, debug output, telemetry, or logs; retain the current behavior of excluding it from the result object.
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 (10)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 29)May include surrounding context.

md
API Key 配置(任选其一,优先级从高到低):
    1. 命令行参数:python enterprise_list.py --key your_api_key --keyword 天聚地合
    2. 环境变量:export JUHE_ENTERPRISE_LIST_KEY=your_api_key
    3. 脚本同目录的 .env 文件:JUHE_ENTERPRISE_LIST_KEY=your_api_key

申请 API Key: https://www.juhe.cn/docs/api/id/192
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

md
API Key 配置(任选其一,优先级从高到低):
    1. 命令行参数:python enterprise_list.py --key your_api_key --keyword 天聚地合
    2. 环境变量:export JUHE_ENTERPRISE_LIST_KEY=your_api_key
    3. 脚本同目录的 .env 文件:JUHE_ENTERPRISE_LIST_KEY=your_api_key

申请 API Key: https://www.juhe.cn/docs/api/id/192
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/enterprise_list.py (reported line 13)May include surrounding context.

python
API Key 配置(任选其一,优先级从高到低):
    1. 命令行参数:python enterprise_list.py --key your_api_key --keyword 天聚地合
    2. 环境变量:export JUHE_ENTERPRISE_LIST_KEY=your_api_key
    3. 脚本同目录的 .env 文件:JUHE_ENTERPRISE_LIST_KEY=your_api_key

申请 API Key: https://www.juhe.cn/docs/api/id/192
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/enterprise_list.py (reported line 218)May include surrounding context.

python
API Key 配置(任选其一,优先级从高到低):
    1. 命令行参数:python enterprise_list.py --key your_api_key --keyword 天聚地合
    2. 环境变量:export JUHE_ENTERPRISE_LIST_KEY=your_api_key
    3. 脚本同目录的 .env 文件:JUHE_ENTERPRISE_LIST_KEY=your_api_key

申请 API Key: https://www.juhe.cn/docs/api/id/192
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/enterprise_list.py (reported line 39)May include surrounding context.

python
if env_key:
        return env_key

    env_file = Path(__file__).parent / ".env"
    if env_file.exists():
        for line in env_file.read_text(encoding="utf-8").splitlines():
            line = line.strip()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documentation indicates capabilities that involve environment variable access, reading local files such as scripts/.env, and making outbound network requests, but it does not declare any explicit tool scope or permission boundaries. This can lead to overbroad execution in agent environments where undeclared capabilities are still available, increasing the chance of unintended secret access or network use beyond what users expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases are broad and include common enterprise-related queries like '查公司' and '工商信息', which may cause the skill to activate on routine conversation without clear user intent. In this skill, unintended invocation matters because activation can result in sending user-provided company identifiers to an external API and consuming a billable credential.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The user-facing description does not clearly disclose that supplied company names, registration numbers, or unified social credit codes will be transmitted to a third-party service operated by juhe.cn. This creates a privacy and transparency issue because users may provide sensitive or regulated identifiers without understanding they are being shared externally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language strings in the docstring, help text, errors, and formatted output consistently force a specific language/locale. The file does not offer any user choice, fallback, or explicit justification for restricting usage to Chinese.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code performs a network request to a third-party service and transmits the keyword plus API credential, where the keyword may contain sensitive company identifiers such as registration numbers or unified social credit codes. Although the script's purpose is to query a remote API, there is no explicit user-facing warning that entered data will be sent to an external provider.

Content

No source excerpt is available for this finding.