T09 · Insecure Skill Coding Practices
- Location
src/payment_api_client.py:52- Finding
Payment API credentials may be transmitted over plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill broadly matches its payment purpose, but it should be reviewed before installation because it can handle payment secrets and initiate refunds without strong built-in safeguards.
Install only if you trust the publisher and can enforce operational controls outside the skill: require HTTPS-only API endpoints, do not run setup with real payment credentials in the environment, rotate any credentials whose fragments may have appeared in logs, update vulnerable dependencies, and require an explicit approval workflow for refunds before allowing production use.
src/payment_api_client.py:52Payment API credentials may be transmitted over plaintext HTTP
src/payment_skill.py:220Refund approval requirement is declared but not enforced
scripts/diagnose.py:209Installation diagnostics disclose portions of payment credentials
src/security.py:115Weak encryption keys are silently accepted through zero padding
scripts/setup.sh:54Dependency installation does not verify package integrity
src/payment_api_client.py:55Request signature may use a different timestamp from the transmitted header
Providing undeclared generic validation and encryption/decryption utilities while lacking core payment functionality is a strong description-behavior mismatch. While those helpers are not inherently malicious, hiding extra cryptographic or data-processing capabilities inside a payment-branded skill can enable misuse and defeats informed consent by the operator.
Providing undeclared generic validation and encryption/decryption utilities while lacking core payment functionality is a strong description-behavior mismatch. While those helpers are not inherently malicious, hiding extra cryptographic or data-processing capabilities inside a payment-branded skill can enable misuse and defeats informed consent by the operator.
Providing undeclared generic validation and encryption/decryption utilities while lacking core payment functionality is a strong description-behavior mismatch. While those helpers are not inherently malicious, hiding extra cryptographic or data-processing capabilities inside a payment-branded skill can enable misuse and defeats informed consent by the operator.
Providing undeclared generic validation and encryption/decryption utilities while lacking core payment functionality is a strong description-behavior mismatch. While those helpers are not inherently malicious, hiding extra cryptographic or data-processing capabilities inside a payment-branded skill can enable misuse and defeats informed consent by the operator.
Pinning aiohttp to 3.6.3 introduces a dependency version with multiple published security advisories, including request/header handling and multipart-related issues. In a payment skill that likely performs network I/O, a vulnerable HTTP client materially increases exposure to denial of service, header injection, cookie handling, or other request-processing attacks.
Pydantic 1.8.2 is flagged for a regular-expression denial-of-service issue. If this payment skill validates attacker-controlled input such as payment metadata, webhook payloads, or user fields, crafted input could trigger excessive CPU consumption and degrade availability.
cryptography 3.4.8 is associated with multiple advisories, including cryptographic weaknesses and vulnerable bundled OpenSSL components. In a payment-oriented skill, cryptographic assurance is central; outdated crypto dependencies can undermine confidentiality, integrity, and trust boundaries around secrets, tokens, or TLS-related operations.
pycryptodome 3.10.4 is flagged for a side-channel issue affecting OAEP decryption. In a payment context, where encrypted secrets, tokens, or sensitive payloads may be processed, side-channel leakage can be especially serious because it may aid key recovery or plaintext inference under certain attack conditions.
pytest is a development/test dependency, so its vulnerable tmpdir handling is less likely to affect production runtime directly. However, it can still matter in CI, local testing, or shared build environments where malicious test inputs or filesystem manipulation could impact integrity or leak data.
The file pins aiohttp==3.9.5, and the static analysis reports multiple known advisories including CRLF injection and cookie-handling issues. In a payment-related skill, HTTP client security matters because outbound requests may carry tokens, session state, or sensitive transaction metadata, so vulnerable request parsing or cookie behavior can increase risk substantially.
cryptography==42.0.5 is reported to include vulnerable OpenSSL components in some wheels, which is particularly serious in a payment skill that likely relies on TLS, key handling, signatures, or encryption. Weaknesses in foundational crypto dependencies can undermine confidentiality and integrity even if the application code appears correct.
pytest==8.2.0 is a known vulnerable dependency according to the reported advisories, but it is listed under test dependencies rather than production runtime. That reduces direct exploitability in deployed payment functionality, though it can still affect CI environments, developer systems, or any pipeline that processes untrusted test inputs.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
配置字典
"""
config_dir = ConfigLoader.get_config_dir()
env_file = config_dir / f"{env_name}.env"
if not env_file.exists():
logger.warning(f"配置文件不存在: {env_file}")
The skill advertises executable behavior involving environment access, file reads, network, and shell execution, yet the manifest does not declare any explicit tool scope such as permissions or allowed-tools. In a payment context, this is risky because the skill handles secrets and can run setup scripts, making it harder for a host or reviewer to constrain what the skill may access or execute.
The refund operation can trigger irreversible or financially destructive actions, but the documentation does not provide an explicit warning or confirmation requirement. In a payment skill, that omission raises the risk of accidental or unauthorized refunds initiated by an agent or user without understanding the consequences.
The file’s natural-language description and all user-facing messages are written exclusively in Chinese, indicating the skill is designed to operate in a single language. There is no indication that the user can choose another language or that the Chinese-only constraint is required for a documented region-specific purpose.
This script performs broad environment and project reconnaissance unrelated to core payment processing, including enumerating dependencies, project files, interpreter details, and configuration state. In a skill context, such host introspection increases the amount of internal metadata exposed to the operator or logs and can aid follow-on attacks or unauthorized profiling of the runtime environment.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print_header("pip 版本检查")
try:
result = subprocess.run(
[sys.executable, "-m", "pip", "--version"],
capture_output=True,
text=True
The script reads payment-related environment variables, including API keys and secrets, and prints masked portions of their values. Even partial secret disclosure confirms presence, format, and fragments of credentials, which can leak into logs, screenshots, CI output, or support channels and materially weaken secret confidentiality.
python-dotenv 0.19.0 has an advisory involving unsafe symlink handling in set_key/arbitrary file overwrite scenarios. While exploitability depends on whether the skill writes .env files or runs in an attacker-influenced filesystem context, the vulnerable version still represents a real supply-chain risk.
python-dotenv==1.0.1 is flagged for a symlink-following issue in set_key that can enable arbitrary file overwrite in some usage patterns. While a requirements file alone does not prove the vulnerable API is used, including a version with known security issues is still a real dependency risk, especially if deployment or tooling modifies .env files during setup or runtime.
The file's user-facing docstring, help text, and runtime messages are written in Chinese, which effectively imposes a specific language on users. The policy allows locale constraints only when justified or when the user is given a language choice, neither of which appears in this file.
This code exposes a refund_payment command, which is an irreversible or safety-critical operation, but the CLI only labels it as '发起退款' and does not present any confirmation prompt or explicit warning at execution time. Although the command name indicates purpose, there is no user disclosure in the execution path that the action may reverse a prior transaction and affect funds.
All user/developer-facing natural-language text in docstrings, log messages, and exception strings is written exclusively in Chinese, with no indication that language choice is configurable or limited to a justified locale-specific context. This can violate language/locale policy when the skill is expected to operate in a broader environment without explicit opt-in.
The manifest describes a payment solution, but this module implements local configuration and secret discovery via os.getenv and direct reads of config/*.env files. While payment processing may need credentials, broad environment-variable and local file access is a separate capability not stated in the manifest and expands the skill's reach into host configuration.