Back to skill

Security audit

身份证二要素核验 - 聚合数据

Security checks for vulnerabilities and agentic risk

Overview

This skill has a legitimate identity-checking purpose, but it handles national ID data and an API key unsafely by using plaintext HTTP and printing full ID details.

Review this skill carefully before installing or using it. It asks for a person's legal name and national ID number and sends them to Juhe for verification; only use it with informed consent. The bundled script should be fixed to use HTTPS, avoid putting sensitive values in URLs where possible, and stop printing unmasked JSON before handling real identity data.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/idcard_verify.py:22
Finding

National Identity Data and API Credential Transmitted over Plaintext HTTP

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/idcard_verify.py:93
Finding

Unmasked Identity Information Exposed Through Raw JSON Output

Content
View full analysis
str: """格式化验证结果""" if not result["success"]: return f"❌ 验证失败:{result.get('error', '未知错误')}" lines = [] lines.append("🆔 身份证实名认证结果") lines.append("") res = result.get("res") if res == 1: lines.append("验证结果:✅ 一致") elif res == 2: lines.append("验证结果:❌ 不一致") else: lines.append(f"验证结果:⚠️ 未知结果 ({res})") realname = result.get("realname", "") idcard = result.get("idcard", "") orderid = result.get("orderid", "") lines.append(f"姓名:{mask_name(realname)}") lines.append(f"身份证:{mask_idcard(idcard)}") if orderid: lines.append(f"订单号:{orderid}") return "\n".join(lines) ``` However, the script subsequently prints the original result dictionary without masking: ```python result = verify_idcard(name, idcard, api_key) print(format_result(result)) print("") print(json.dumps(result, ensure_ascii=False, indent=2)) ``` ### Technical Analysis The formatted result correctly masks the person's name and identity-card number, but this protection is immediately defeated by serializing the original result dictionary. The dictionary contains the complete values returned by the service or, if the corresponding response fields are absent, t ...[truncated 1939 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The documentation instructs users to write the API key into scripts/.env, which can lead to credential exposure if that file is accidentally committed, shared, or read by other local tooling. In agent-skill repositories, colocating secrets inside the project tree increases the chance of inadvertent disclosure through source control or artifact packaging.

Content

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

md
export JUHE_IDCARD_VERIFY_KEY=你的 AppKey

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

# 方式三:每次命令行传入
python scripts/idcard_verify.py --key 你的 AppKey --name 张三 --idcard 110101199001011234

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The direct API example places a real name and full ID-card number in a GET URL, which is especially risky because URLs are commonly logged by clients, proxies, servers, browser history, and monitoring tools. For identity-verification data, this creates a significant exposure path for sensitive PII even if TLS is used in transit.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The usage guidance tells the agent to collect a person's real name and ID-card number and send them for verification, but it does not explicitly warn that this highly sensitive PII is being transmitted to a third-party provider. In this context, omission of notice and consent is dangerous because users may disclose regulated identity data without understanding who receives it or how it is processed.

Content

No source excerpt is available for this finding.

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 27)May include surrounding context.

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

免费申请 API Key: https://www.juhe.cn/docs/api/id/103
"""

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/idcard_verify.py (reported line 12)May include surrounding context.

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

免费申请 API Key: https://www.juhe.cn/docs/api/id/103
"""

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/idcard_verify.py (reported line 191)May include surrounding context.

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

免费申请 API Key: https://www.juhe.cn/docs/api/id/103
"""

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script sends highly sensitive PII (real name and national ID number) to a third-party API and uses an HTTP endpoint, which exposes the request URL and query parameters to interception or logging in transit. It also does not present an explicit user-facing disclosure that this data will leave the local environment and be processed by an external service, increasing privacy and compliance risk.

Content

No source excerpt is available for this finding.

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/idcard_verify.py (reported line 38)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
91% confidence
Finding

The skill declares code-relevant capabilities (environment variable access, file reads, and outbound network use) but does not explicitly scope or disclose them via a permissions or allowed-tools declaration. This weakens the trust boundary for an agent runtime and can cause sensitive operations, especially third-party network transmission of identity data, to occur without clear operator awareness or policy enforcement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

All user-facing documentation, help text, errors, and output strings are hard-coded in Chinese. The file does not provide any opt-in language selection or state that the tool is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.