Back to skill

Security audit

Elon马斯克情报内参

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a small demo HTTP service, but it exposes a payment-style endpoint and ships a live-looking payment API key, so it needs review before installation.

Review this before installing. Only use it if you are comfortable running an unauthenticated HTTP service reachable on all interfaces and seeing a payment-style link returned from POST /invoke. The SkillPay key in main.py should be treated as exposed and removed or rotated before any real use; real payment behavior should require authentication, explicit user confirmation, and tighter host/port scoping.

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
main.py:7
Finding
Hardcoded SkillPay API Credential## Vulnerability Details **File Location**: `main.py`, lines 7–8 **Vulnerability Type**: Hardcoded secret in source code **Risk Level**: High ### Vulnerable Code ```python SKILLPAY_API_KEY = "sk_8b36c2ca9e774eb0243752f907b086e78c8af866a4088d3e3475113ed446b71" SKILLPAY_API_BASE = "https://api.skillpay.me" ``` ### Technical Analysis A secret-looking SkillPay API credential is embedded directly in distributable source code. Any person or system with access to the project package can recover this value without authentication. Although `main.py` does not currently use the credential and the configured entry point is `python bare.py`, inclusion in the package still constitutes credential exposure. Static analysis cannot establish whether the key is active, expired, revoked, or which permissions it grants. Removing it from the current file alone may also be insufficient if it exists in repository history, build artifacts, logs, caches, or previously distributed packages. ### Attack Path 1. An attacker obtains the project source, package, build artifact, or repository history. 2. The attacker reads `main.py` and extracts `SKILLPAY_API_KEY`. 3. The attacker attempts to authenticate to `https://api.skillpay.me` using the exposed key. 4. If the credential remains valid, the attacker invokes API operations allowed by its assigned permissions. 5. The attacker may continue using the credential until it is revoked, rotated, expired, or blocked by provider-side restrictions. No interaction with the running application is necessary to extract the credential. ### Impact Assessment If the key is valid, an attacker could impersonate the associated API client and obtain all privileges granted to that credential. Depending on provider-side authorization, this could include consuming paid resources, creating unauthorized transactions or payment objects, accessing account-related API data, or disrupting legitimate service usage. The precise scope cannot be confirmed from th ...[truncated 175 chars]
Remediation
## Remediation Suggestions 1. Revoke the exposed credential immediately and issue a replacement; do not assume deletion from the source makes the existing key safe. 2. Remove the credential from the current source, repository history, release archives, build artifacts, logs, and caches where feasible. 3. Supply the replacement through a managed secret store or protected environment variable: ```python import os SKILLPAY_API_KEY = os.environ.get("SKILLPAY_API_KEY") if not SKILLPAY_API_KEY: raise RuntimeError("SKILLPAY_API_KEY is not configured") ``` 4. Do not commit example secrets that resemble usable credentials. Use an unmistakable placeholder in documentation, such as `SKILLPAY_API_KEY=replace_me`. 5. Grant the replacement key only the minimum API permissions required by the application. 6. Apply provider-supported restrictions, such as environment, account, endpoint, source-network, spending, or rate limits. 7. Review SkillPay access and transaction logs for use of the exposed credential and investigate unexpected activity. 8. Add automated secret scanning to pre-commit hooks and CI pipelines to prevent recurrence. 9. Ensure production deployments inject secrets at runtime and prevent secret values from appearing in exception messages or application logs.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill explicitly documents a POST /invoke endpoint that returns a payment link, but the description provides no warning that invoking it may initiate or advance a monetization flow. Even if the current implementation is only a demo URL, undisclosed payment-related behavior can mislead users or calling agents into triggering financial actions without informed consent, and the ambiguity increases risk if the demo is later replaced with a real payment endpoint.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The code intentionally starts an HTTP server on 0.0.0.0 and attempts multiple common ports, exposing unauthenticated endpoints including a payment/charge flow at /invoke. In a skill with no documented need to host a network service or solicit payments, this creates an unjustified remote-facing surface and indicates possible deceptive monetization or policy evasion behavior.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The /invoke response hard-codes Chinese text in the title and notice, which imposes a specific language on users without opt-in or fallback. This matches a natural-language policy issue because the file provides no indication that the skill is region-specific or that users can choose their preferred language.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The payment message returned by the POST endpoint is only in Chinese and does not offer any language choice. Without a documented region-specific purpose, this is a language policy violation under the natural-language rules.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
User-facing messages such as the briefing title, payment notice, and payment message are presented only in Chinese, and surrounding comments are also Chinese-only. This creates a language policy concern because the skill does not offer any language/locale choice or document that it is intentionally limited to Chinese users.

Missing User Warnings

Medium
Confidence
99% confidence
Finding
A live-looking SkillPay API key is hardcoded directly in source code, which exposes a sensitive credential to anyone with code access and makes accidental leakage through repositories, logs, or redistribution likely. If valid, an attacker could abuse the payment API, impersonate the service, create fraudulent transactions, or consume billable resources.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The POST /invoke handler states it directly connects to SkillPay and returns a payment link, which implies an external payment workflow. The code includes no confirmation prompt, logging, or warning comment disclosing that user requests may initiate a third-party payment action or expose data to an external service.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The manifest description is written entirely in Chinese, which imposes a specific language/locale in user-facing skill metadata without any opt-in, alternative locale, or justification. This matches the policy category for language or locale constraints expressed in natural-language content.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The skill switches into Chinese for its core description (`简介`) and functionality summary without indicating that language choice is optional or that the skill is intended for a Chinese-only audience. The policy requires flagging language or locale constraints when a specific language is imposed without user opt-in or documented justification.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
The comment at L07 says the service no longer relies on any external environment variables. However, the startup logic at L45-L63 reads HOST and several port-related environment variables to determine binding configuration. This is a direct contradiction between the inline documentation and the code's actual behavior.

Static analysis

No suspicious patterns detected.