Back to skill

Security audit

银行卡三要素核验 - 聚合数据

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate verification purpose, but it handles bank and identity details in an unsafe, under-confirmed way.

Review before installing. Use only with explicit user consent to send full bank card, legal name, and ID number to Juhe. Do not use this version for real data unless the endpoint is changed to HTTPS or otherwise verified secure; avoid passing the API key on the command line or storing it in a repository-local .env file.

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
scripts/verify_bankcard_three.py:25
Finding
Banking, identity, and credential data transmitted over plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/verify_bankcard_three.py:25`, `scripts/verify_bankcard_three.py:111-120`; insecure direct-call instructions also appear in `SKILL.md:59-60` **Vulnerability Type**: Plaintext transmission of sensitive information **Risk Level**: High ### Vulnerable Code ```python API_URL = "http://v.juhe.cn/verifybankcard3/query" ``` ```python params = urllib.parse.urlencode({ "key": api_key, "bankcard": bankcard, "realname": realname, "idcard": idcard, }) url = f"{API_URL}?{params}" try: with urllib.request.urlopen(url, timeout=15) as resp: data = json.loads(resp.read().decode("utf-8")) ``` The Skill documentation explicitly recommends the same insecure request: ```text GET http://v.juhe.cn/verifybankcard3/query?key=YOUR_KEY&bankcard=卡号&realname=姓名&idcard=身份证号 ``` ### Technical Analysis The script constructs an unencrypted HTTP request containing: - The full bank card number - The cardholder's legal name - The full national identity number - The Juhe API credential Because the endpoint uses `http://` rather than `https://`, TLS does not protect the confidentiality, integrity, or authenticity of the request and response. Network intermediaries can inspect the request or alter the returned verification result. All sensitive values are also embedded in the URL query string. URLs are commonly recorded by HTTP servers, reverse proxies, gateways, monitoring systems, and debugging tools. Consequently, even if transport encryption were added, using query parameters would still create avoidable logging exposure unless the provider requires this request format and all relevant logs are appropriately protected. The script masks the bank card and identity numbers in its final terminal JSON output, but this masking happens only after the complete values have already been transmitted. It therefore does not mitigate network or URL-log exposure. Sending these values to the declared Juhe veri ...[truncated 1701 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the HTTP endpoint with the provider's officially supported HTTPS endpoint. Do not silently fall back to HTTP. 2. Confirm that certificate and hostname verification remain enabled. Fail closed if TLS negotiation or certificate validation fails. 3. If the provider supports it, send sensitive values in a POST body rather than in URL query parameters. 4. Send the API credential through the provider's recommended authorization header where supported, instead of embedding it in the URL. 5. Prevent redirects from HTTPS to HTTP, or validate every redirect target before following it. 6. Update `SKILL.md` so that all documented examples use HTTPS and discourage direct requests that expose personal data in URLs. 7. Inform users clearly that their bank card number, legal name, and identity number will be sent to a third-party verification provider, and obtain appropriate consent before transmission. 8. Avoid accepting the API key through `--key` where possible because command-line arguments can appear in shell history and process listings. Prefer a protected environment variable or a credential store. 9. Ensure `.env` files containing credentials are excluded from version control and have restrictive filesystem permissions. 10. Minimize logging throughout the request path and redact bank card numbers, identity numbers, names, API keys, and complete request URLs from errors and diagnostic output. ]]>
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill states it will send bank card number, real name, and national ID number to a third-party API, but it does not include a clear user-facing notice and consent requirement before transmission. This is especially dangerous because these are highly sensitive personal and financial identifiers, and disclosure to an external provider can create privacy, compliance, and misuse risks.

Credential Access

High
Category
Privilege Escalation
Content
export JUHE_BANKCARD3_KEY=你的AppKey

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

# 方式三:每次命令行传入
python scripts/verify_bankcard_three.py --key 你的AppKey --bankcard 卡号 --realname 姓名 --idcard 身份证号
Confidence
84% confidence
Finding
The documentation explicitly recommends writing the API key into scripts/.env, a local file in the project tree. Storing credentials in a workspace file increases the chance of accidental exposure through source control, backups, logs, or other tools that can read files in the project, especially in agent environments with file-read capabilities.

Credential Access

High
Category
Privilege Escalation
Content
API Key 配置(任选其一,优先级从高到低):
    1. 环境变量: export JUHE_BANKCARD3_KEY=your_api_key
    2. 脚本同目录的 .env 文件: JUHE_BANKCARD3_KEY=your_api_key
    3. 直接传参: python verify_bankcard_three.py --key your_api_key ...

免费申请 API Key: https://www.juhe.cn/docs/api/id/207
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
API Key 配置(任选其一,优先级从高到低):
    1. 环境变量: export JUHE_BANKCARD3_KEY=your_api_key
    2. 脚本同目录的 .env 文件: JUHE_BANKCARD3_KEY=your_api_key
    3. 直接传参: python verify_bankcard_three.py --key your_api_key ...

免费申请 API Key: https://www.juhe.cn/docs/api/id/207
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
API Key 配置(任选其一,优先级从高到低):
    1. 环境变量: export JUHE_BANKCARD3_KEY=your_api_key
    2. 脚本同目录的 .env 文件: JUHE_BANKCARD3_KEY=your_api_key
    3. 直接传参: python verify_bankcard_three.py --key your_api_key ...

免费申请 API Key: https://www.juhe.cn/docs/api/id/207
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

High
Confidence
99% confidence
Finding
The script sends highly sensitive personal data and the API key to an HTTP endpoint using query parameters, exposing bank card numbers, names, ID numbers, and credentials to interception or modification by any network attacker on the path. In this skill context, the risk is elevated because the data is financial and identity-related PII, making confidentiality and integrity critical.

Credential Access

High
Category
Privilege Escalation
Content
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()
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill performs sensitive operations including reading environment variables, local file access, and outbound network requests, but it does not declare an explicit tool scope or permissions boundary. In an agent setting, this weakens least-privilege controls and makes it easier for the skill to be invoked with broader capabilities than users or reviewers expect.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The trigger description is broad and based on loose natural-language examples without clear exclusions or confirmation steps. Because this skill handles highly sensitive financial and identity data, overbroad triggering can cause accidental collection and transmission of personal information to a third party when the user did not intend to invoke this exact verification workflow.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The module docstring says `python verify_bankcard_three.py --file data.csv # 批量核验`, and later help text repeats the same capability, but the CLI parser has no branch for `--file`. This is an active contradiction between documentation and implementation, not merely missing detail.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The documentation explicitly encourages passing the API key via --key on the command line, which can expose the credential through shell history, process listings, logging, and job-control tooling. While this does not guarantee compromise on every system, it is an avoidable secret-handling weakness.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The manifest and module docstring both state that the skill supports 批量核验 and the help text advertises a --file mode, but the argument parser never handles a --file option and no CSV batch-processing logic is implemented. The actual code only performs a single verification request, so the delivered behavior is narrower than the stated functionality.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The runtime help lists `--file` as a supported parameter for CSV batch verification, yet the argument-parsing loop never recognizes `--file`, leaving `file_path` permanently unset. This causes the documented interface to diverge from the actual behavior users receive.

Static analysis

No suspicious patterns detected.