Back to skill

Security audit

识别5300中银行流水样式、识别简版征信、详版征信、企业版征信等各种信贷文件汇总成专业分析报告。

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it handles very sensitive credit and banking documents through a third-party service with under-disclosed data handling and an exposed embedded API credential.

Review before installing. Only use this with documents you are allowed to send to ipipei, avoid long-lived public URLs, and do not pass PDF passwords on the command line. The publisher should remove and rotate the embedded enterprise key, add an explicit consent/privacy notice, and provide safer password handling before broad use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/analyze.py:17
Finding
Hard-Coded Enterprise API Credential<![CDATA[ ## Vulnerability Details **File Location**: `scripts/analyze.py`, lines 17–44 **Vulnerability Type**: Hard-coded service credential **Risk Level**: High ### Vulnerable Code ```python BASE_URL = "https://www.ipipei.com/prod-api" ENTERPRISE_KEY = "26b22ed9a21c42ec89b07b6299cdceb5" ``` The credential is subsequently used to request an authorization token: ```python def get_token(): payload = {"enterpriseKey": ENTERPRISE_KEY, "dateTime": now_text()} data = post("enterpriseApi/getToken", payload) if str(data.get("code")) != "200": print(f"[错误] 获取 Token 失败: {json.dumps(data, ensure_ascii=False)}", file=sys.stderr) sys.exit(1) return data["data"] ``` ### Technical Analysis A reusable enterprise key is embedded directly in the distributed source code. Anyone who can download or inspect the Skill can recover the key without authentication. The key is sent to the provider's `enterpriseApi/getToken` endpoint to obtain an authorization token, making it an active credential rather than a non-sensitive identifier. Embedding credentials in source prevents effective access separation between Skill users and exposes the credential through source repositories, package archives, backups, and local installations. Although the precise provider-side permissions cannot be determined from the reviewed code, an attacker can exercise any API capabilities granted to this enterprise key. ### Attack Path 1. An attacker obtains the Skill package or reads `scripts/analyze.py`. 2. The attacker extracts the hard-coded `ENTERPRISE_KEY`. 3. The attacker submits the key and a current timestamp to `https://www.ipipei.com/prod-api/enterpriseApi/getToken`. 4. If the credential remains valid, the attacker receives an authorization token. 5. The attacker invokes provider API operations permitted by that token independently of the Skill. 6. Unauthorized requests may consume the account's quota, incur costs, or process attacker-controlled documents und ...[truncated 598 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Revoke and rotate the exposed enterprise key immediately. 2. Remove the credential from the source code and repository history. 3. Load a per-deployment or per-user credential from an environment variable or managed secret store. 4. Fail securely when the secret is missing rather than providing a shared fallback value. 5. Assign the credential only the minimum API scopes required for token acquisition, file submission, and result polling. 6. Configure provider-side rate limits, spending limits, expiration, source restrictions, and anomaly alerts where supported. 7. Use separate credentials for development, testing, and production. 8. Add secret scanning to the development and release pipeline to prevent future credential commits. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/analyze.py:128
Finding
PDF Password Exposure Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/analyze.py`, lines 128–145; `SKILL.md`, lines 35–36 **Vulnerability Type**: Plaintext sensitive data in process arguments **Risk Level**: Medium ### Vulnerable Code The script accepts the document password directly as a command-line argument: ```python parser.add_argument("--password", default=None, help="PDF 密码(如有)") ``` It then forwards that value to the remote upload function: ```python result_id = upload_file(token, args.url, args.type, args.file_type, file_name, args.password) ``` The documented invocation explicitly instructs users to place the password on the command line: ```bash # 详版征信 PDF(带密码) python scripts/analyze.py --url "https://example.com/detail.pdf" --type "详版征信" --password "abc123" ``` Within `upload_file`, the supplied password is included in the remote request payload: ```python if password: payload["passWord"] = password ``` ### Technical Analysis Command-line arguments are not an appropriate channel for secrets. Depending on the operating system and execution environment, arguments may be visible to other local users through process-listing facilities, captured by monitoring or orchestration systems, recorded in terminal session logs, or retained in shell history. The password protects documents containing highly sensitive credit or banking information. Disclosure may allow an observer who can also obtain the document URL or file to decrypt its contents. Transmitting the password to the declared parsing provider is functionally necessary for server-side parsing of an encrypted document, but accepting it as a command-line argument is not the least-exposure implementation. The transmission also means the remote provider receives both access to the document and its decryption secret. ### Attack Path 1. A user follows the documented example and invokes the script with `--password`. 2. The plaintext password becomes part of the process argument vector and may be ...[truncated 887 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove or deprecate the `--password` command-line option. 2. Prompt interactively using Python's `getpass.getpass()` so the password is not echoed or placed in the process argument vector. 3. For unattended use, accept the password through a protected secret manager or permission-restricted file descriptor rather than a command-line value. 4. Avoid environment variables where stronger secret-delivery mechanisms are available, because environment data may also be exposed in diagnostics or process inspection. 5. Remove plaintext password examples from `SKILL.md`. 6. Clearly disclose that encrypted-document parsing sends the password and document location to the external provider, and require informed user consent. 7. Ensure application and HTTP diagnostic logs redact the password field. 8. Minimize the password's lifetime in memory and do not persist it after the request completes. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:14
Finding
Unpinned Third-Party Runtime Dependency<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 14 **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Low ### Vulnerable Code ```markdown - 需要安装 `requests` 库(`pip install requests`) ``` ### Technical Analysis The installation instruction resolves `requests` without a fixed version or integrity hash. Consequently, installations performed at different times can retrieve different package versions. This weakens reproducibility and causes users to trust whatever release the configured package index serves at installation time. The dependency name is the legitimate `requests` package rather than an apparent typosquat, and the audit found no evidence that the project intentionally introduces a malicious package. The risk arises from unconstrained dependency resolution, future dependency compromise, unexpected breaking changes, or use of an untrusted package index. ### Attack Path 1. A user follows the documentation and runs `pip install requests`. 2. The package installer queries its configured package index and selects the current compatible release rather than a reviewed version. 3. If the index, account, package release, or dependency resolution path is compromised, the installer retrieves attacker-controlled content. 4. Package installation or subsequent import executes the compromised package code with the privileges of the user running the Skill. ### Impact Assessment A compromised dependency can execute arbitrary Python code in the Skill's process context. Its effective access can include files, environment variables, network connectivity, and credentials available to that user. No current compromise or malicious behavior in `requests` was established by this audit. The finding concerns missing version and integrity controls, so its present risk is lower than that of the directly exposed enterprise credential. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Declare dependencies in a reviewed requirements or lock file. 2. Pin an approved `requests` version and update it through a controlled dependency-review process. 3. Use hash verification, such as `pip install --require-hashes -r requirements.txt`, to validate downloaded artifacts. 4. Install only from a trusted package index and disable unintended extra indexes. 5. Run dependency vulnerability and provenance checks in CI. 6. Periodically update the pinned version after reviewing security advisories and compatibility. 7. Install dependencies in an isolated virtual environment with only the permissions required by the Skill. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill processes highly sensitive financial and identity documents, requires users to provide publicly accessible URLs, and may transmit optional PDF passwords to a third-party service, yet it does not clearly warn users about these privacy and security implications. In this context, the omission is especially dangerous because credit reports and bank statements contain PII, financial account data, and risk signals that could lead to identity theft, privacy violations, or unauthorized data exposure if mishandled.

Missing User Warnings

High
Confidence
97% confidence
Finding
This code uploads credit reports and bank statements—highly sensitive financial and personal data—to a remote API, but provides no explicit consent flow, privacy notice, data-handling warning, or validation that the user understands third-party transmission. In this skill context, that is especially dangerous because the files may contain PII, financial history, account data, and passwords for protected PDFs.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill invokes a networked third-party parsing workflow but does not declare any tool scope, permissions, or allowed-tools boundaries. This weakens governance and reviewability, making it harder to enforce least privilege and increasing the chance the skill is used with broader network access than intended.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The instruction '用清晰的中文向用户呈现' requires responses in Chinese, but the skill does not provide a language preference option or explain that the skill is limited to a Chinese-speaking context. This creates a natural-language policy concern because it forces a specific language without user opt-in.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
All user-facing text, help output, and argument descriptions are in Chinese, which effectively forces a specific language without offering opt-in or documenting a justified locale restriction. This matches the language/locale policy concern for natural-language behavior across file types.

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
The script contains a hard-coded enterprise API credential in source code, which is a real secret exposure issue. Anyone who can read the code can reuse the key to obtain tokens and access the third-party service under the organization's identity, leading to unauthorized use, quota abuse, billing impact, and possible downstream exposure of sensitive processing capabilities.

External Transmission

Medium
Category
Data Exfiltration
Content
if token:
        headers["Authorization"] = token
    url = f"{BASE_URL}/{path.lstrip('/')}"
    resp = requests.post(url, json=payload, headers=headers, timeout=timeout)
    resp.raise_for_status()
    return resp.json()
Confidence
90% confidence
Finding
The script transmits user-supplied document URLs, analysis metadata, and possibly PDF passwords to an external service via HTTP requests. External transmission is expected for this skill's functionality, but in this context it still represents a meaningful security/privacy risk because the data involved is sensitive financial information and there are no compensating controls such as consent, destination allowlisting beyond a fixed host, or masking of secrets.

Static analysis

No suspicious patterns detected.