Back to skill

Security audit

(司库系统)API 全生命周期管理智能 Skill

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed PSBC treasury API documentation, validation, sample-client, and mock-response skill; its financial examples need careful handling but the artifacts do not show hidden or malicious behavior.

Install only if you are intentionally working on PSBC treasury integrations. Treat all examples as sensitive banking code: use synthetic or masked data, do not run the curl/Python network examples against production unless you have authorization and approvals, pin and review crypto dependencies, and keep private keys/certificates in managed key storage rather than editing them into examples.

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

T08 · Insecure Dependencies

Note
Location
README.md:121
Finding
Unpinned Third-Party Cryptographic Dependency## Vulnerability Details **File Location**: `README.md`, lines 116-123 **Vulnerability Type**: Unpinned package installation **Risk Level**: Low ```markdown ### Cryptographic Algorithm Integration A cryptographic library such as `gmssl` or `pysm2` must be integrated to implement actual encryption and decryption: ```bash pip install gmssl ``` ``` ### Technical Analysis The installation instruction retrieves the latest available version of `gmssl` from the package index without specifying an exact version or verifying an artifact hash. Consequently, the installed code is not reproducible and may differ from the version reviewed or tested by the project author. This is particularly sensitive because the dependency is intended to perform cryptographic operations involving business payloads, signatures, certificates, and private keys. If the package, its maintainer account, its release process, or the configured Python package index were compromised, a malicious release could execute during installation or when imported by an implementation based on this example. The package name itself is not demonstrated to be malicious, and the project does not automatically execute this installation command. The risk arises when a user follows the documented command without dependency pinning or integrity verification. ### Attack Path 1. An attacker compromises the upstream package, its publisher credentials, the package index, or a dependency resolved by the package. 2. The attacker publishes a malicious version that still satisfies the unrestricted `pip install gmssl` command. 3. A user follows the README and installs the package. 4. Malicious package installation hooks or imported runtime code execute with the privileges of the user performing the installation. 5. Because the package is intended for cryptographic integration, malicious code could potentially access private keys, plaintext financial payloads, encrypted session key ...[truncated 1148 chars]
Remediation
## Remediation Suggestions 1. Pin the dependency to a reviewed exact version, for example: ```bash python -m pip install "gmssl==<reviewed-version>" ``` 2. Maintain dependencies in a lock file or requirements file containing cryptographic hashes, and install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Record and verify hashes for all transitive dependencies, not only the direct cryptographic package. 4. Use a controlled internal package mirror or allowlisted registry for production installations. 5. Review the selected library's source, release history, maintenance status, and cryptographic implementation before using it with production keys or financial data. 6. Install dependencies inside a dedicated virtual environment as an unprivileged user rather than globally or with administrator privileges. 7. Add automated dependency vulnerability and provenance scanning to the release process. 8. Keep private-key operations in a hardware security module or dedicated key-management service where possible, preventing the Python dependency from directly reading exportable private-key material.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Presenting the skill as general API lifecycle management obscures that it is actually specialized for PSBC treasury schemas, transaction codes, and message validation workflows. This is primarily a trust and transparency problem: users and orchestrators may apply the skill in contexts they would avoid if they knew it was specialized for sensitive banking message construction and validation, especially where certificate and encrypted-field handling are involved.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
Presenting the skill as general API lifecycle management obscures that it is actually specialized for PSBC treasury schemas, transaction codes, and message validation workflows. This is primarily a trust and transparency problem: users and orchestrators may apply the skill in contexts they would avoid if they knew it was specialized for sensitive banking message construction and validation, especially where certificate and encrypted-field handling are involved.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Presenting the skill as general API lifecycle management obscures that it is actually specialized for PSBC treasury schemas, transaction codes, and message validation workflows. This is primarily a trust and transparency problem: users and orchestrators may apply the skill in contexts they would avoid if they knew it was specialized for sensitive banking message construction and validation, especially where certificate and encrypted-field handling are involved.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Presenting the skill as general API lifecycle management obscures that it is actually specialized for PSBC treasury schemas, transaction codes, and message validation workflows. This is primarily a trust and transparency problem: users and orchestrators may apply the skill in contexts they would avoid if they knew it was specialized for sensitive banking message construction and validation, especially where certificate and encrypted-field handling are involved.

Obfuscated Code

High
Category
Supply Chain
Content
"feedAckTime": int(datetime.now().timestamp() * 1000),
                "id": request_data.get("id", ""),
                "fileType": "pdf",
                "file": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZVJHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodCAzMDAvRmlsdGVyL0RDVERlY29kZS9UeXBlL1hPYmplY3QvV2lkdGggNjA3L0JpdHNQZXJDb21wb25lbnQgOC9MZW5ndGggMzg5ODc+PnN0cmVhbQr/2P/gABBKRklGAAEBAQCWAJYAAP/tAFZQaG90b3Nob3AgMy4wADhCSU0EBAAAAAAAHRwBWgADGyVHHAIAAAIAAhwCUAAJ5Y2i5rSq5rWpADhCSU0EJQAAAAAAEF2fC+4ARFZdTWLwd7fQr8v/4RoKRXhpZgAATU0AKgAAAAgACQES"
            }
        }
Confidence
50% confidence
Finding
Code contains obfuscation (base64, hex encoding with execution). This is often used to hide malicious functionality.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The README provides banking API usage examples with realistic account identifiers and direct invocation guidance, but does not warn users against using real customer/account data in examples, logs, mocks, or test environments. In a treasury/banking integration skill, that omission increases the chance of sensitive financial data exposure through copy-pasted samples, debugging output, or misuse of non-production controls.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The manifest exposes high-risk treasury capabilities including account enumeration, balance and transaction queries, payroll file upload, payment initiation, fund allocation, receipt download, and passwordless login token retrieval, but it does not declare any invocation constraints, user-consent gates, role restrictions, or other scope limitations. In an agent setting, this increases the chance that a prompt-induced or over-broad invocation could trigger sensitive financial operations or disclose regulated financial data without sufficient authorization context.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The script sends a POST request containing account-related request data to a remote banking API via curl. While comments describe the technical request format, there is no user-facing prompt, warning, or explicit disclosure near execution that running the script will transmit potentially sensitive financial data over the network.

External Transmission

Medium
Category
Data Exfiltration
Content
)

# 发送请求
curl -X POST "${BASE_URL}" \
  -H "Content-Type: application/json;charset=UTF-8" \
  -d "${REQUEST_PAYLOAD}" \
  -v
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
82% confidence
Finding
This code file performs a network POST of request_data to an external banking endpoint, which may include account and payment information. Although the module docstring mentions HTTP requests, the send_request method itself provides no confirmation, logging, or explicit user-facing warning before transmitting potentially sensitive data.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The error-response generator returns a success status in `txComm` (`respCode: 0000000000000000`, `respDesc: 交易成功`) while also embedding a business error elsewhere. This inconsistency can cause calling systems to treat failed operations as successful, potentially bypassing error handling, retries, rollback logic, or operator review in treasury/payment workflows.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The function named as decrypting business data does not decrypt `encData` and instead falls back to fabricated default values, including a hardcoded tenant identifier. In a security-sensitive treasury context, this can make downstream logic operate on incorrect or spoofed request attributes, masking malformed input and undermining assumptions about authenticity and tenant isolation.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The file forces a single language presentation throughout the skill documentation, and there is no indication that users can choose another language or that the skill is intentionally restricted to a Chinese-only audience. Under the stated policy, a fixed language without opt-in or documented justification is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
All user-facing names and descriptions in the manifest are written in Chinese, and the file does not indicate that the skill is region-specific or that users may choose another language. This can violate language/locale policy where skills must not force a specific language without opt-in or justification.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The script's human-readable instructions and comments are entirely in Chinese, which can amount to a language-policy issue when a skill implicitly requires a specific language without opt-in or documented justification. No language choice or scope limitation is provided in the file.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The file's natural-language descriptions, docstrings, comments, exception messages, and printed output are entirely in Chinese, with no option for another language. Under the stated policy, forcing a specific language without user opt-in is a locale/language policy concern.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
The module title and all user-facing descriptions are written only in Chinese, including the CLI prompts later in the file. Under the policy for natural-language violations, this is a locale/language constraint without any opt-in or documented justification in the file.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
This JSON includes primary human-readable fields such as "description" and many appendix labels only in Chinese, while English appears inconsistently in separate fields and is absent for large portions of the file. Because the natural-language content establishes a default locale without any opt-in or documented locale selection, it may violate a language/locale policy requiring user choice.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The module title and all user-facing descriptions are written only in Chinese, including the interactive prompts and tool description. This imposes a single language/locale on users without offering any choice or documenting that the skill is intentionally limited to a Chinese-speaking environment.

Static analysis

No suspicious patterns detected.