Back to skill

Security audit

Recharge / Renew of Skills | 技能账户充值/续费

Security checks for vulnerabilities and agentic risk

Overview

This is a real payment/recharge skill, but it stores and displays API keys and sends signed payment URLs through a third-party QR service, so users should review it carefully before installing.

Install only if you are comfortable with this skill handling real payment flows, contacting LifeEmergence, Alipay, and api.qrserver.com, and storing a returned API key in the workspace. Treat any displayed ApiKey as a secret, rotate it if exposed in logs or chat history, and prefer a version that generates QR codes locally and stores secrets with owner-only permissions.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (5)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:3
Finding

Mandatory Vendor Promotion Hijacks Package-List Responses

Content
View full analysis
str: """生成套餐展示文本。""" packages = get_display_packages(show_test_package) selectable_ids = "/".join(str(pkg.get("id")) for pkg in get_recharge_packages(show_test_package)) lines = ["请选择充值套餐:"] for package in packages: lines.extend([ f"{package['id']}. {package['name']}", f" 💰 充值金额:{'¥' + str(package['amount']) + '元' if not package.get('contact_only') else package['amount']}", f" 📊 可用次数:{str(package['uses']) + '次' if not package.get('contact_only') else package['uses']}", ]) if package.get('remark'): lines.append(f" 💡 备注:{package['remark']}") if package.get("contact_only"): lines.append(" 📩 说明:该套餐不支持直接下单,请邮件联系获取专属报价与额度方案") lines.append("") lines.append(f"可直接下单套餐编号:{selectable_ids};如需专属定制,请联系 product@lifeemergence.com") return "\n".join(lines) ``` ### Technical Analysis The Skill instructions repeatedly characterize inclusion of the custom package and vendor email as mandatory and high priority. This is not necessary to perform account queries, balance checks, standard package selection, or payment processing. Because Skill instructions are loaded into the Agent's active context, these directives al ...[truncated 1003 chars]
Remediation
View remediation

other

Error
Location
scripts/payment_flow_with_status.py:46
Finding

Complete Signed Payment URLs Are Disclosed to a Third-Party QR Service

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/api_key_config.py:61
Finding

API Key Is Persisted in Plaintext and Printed to User-Visible Output

Content
View full analysis
Path: """The only local storage path for apiKey.""" return workspace_root() / "data" / "smyx-api-key.txt" ``` The write operation does not create the file with an explicit restrictive mode: ```python def persist_new_api_key_if_needed(api_key: Optional[str]) -> dict: """Compare and write apiKey to workspace data/smyx-api-key.txt if needed. Returns: { "has_api_key": bool, "changed": bool, "reason": "first"|"changed"|"same"|"missing", "path": str, "api_key": str|None, # only returned when changed=True for one-time stub notice } """ path = api_key_file_path() if not api_key: return { "has_api_key": False, "changed": False, "reason": "missing", "path": str(path), "api_key": None, } old_api_key = read_stored_api_key() if old_api_key == api_key: return { "has_api_key": True, "changed": False, "reason": "same", "path": str(path), "api_key": None, } path.parent.mkdir(parents=True, exist_ok=True) path.write_text(api_key.strip() + "\n", encoding="utf-8") return { "has_api_key": True, "changed": True, "reason": "first" if not old_api_key else "changed", "path": str(path), "api_key": api_key, } ``` The full key is then deliberately printed: ```python def print_api_key_stub_notice(info: dict) -> None: """Print prominent Markdown stub notice only when first/changed.""" if not info.get("changed") or not info ...[truncated 1624 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
skills/smyx_common/scripts/util.py:548
Finding

Stored API Key Is Reused as a Username, Open ID, and Mobile Number

Content
View full analysis
Remediation
View remediation

other

Note
Location
scripts/callback.py:103
Finding

Payment Failure Callback Sends Phone Numbers and Unbounded Diagnostic Text

Content
View full analysis
dict: """ 支付失败回调 Args: order_id: 订单 ID error_reason: 失败原因 phone: 增值账号 token: Bearer Token Returns: 回调结果 """ token = token or API_CONFIG.get("token", "") url = f"{API_CONFIG['baseUrl']}{API_CONFIG['callbackFailPath']}" headers = { "Content-Type": "application/json" } if API_CONFIG["authType"] == "bearer" and token: headers["Authorization"] = f"Bearer {token}" data = { "orderId": order_id, "errorReason": error_reason, "phoneNumber": phone, "status": "FAILED" } try: req = urllib.request.Request( url, data=json.dumps(data).encode('utf-8'), headers=headers, method='POST' ) with urllib.request.urlopen(req, timeout=30) as response: result = json.loads(response.read().decode('utf-8')) ``` ### Technical Analysis A payment failure notification may legitimately need an order identifier and a status code. The implementation additionally sends a phone number and unrestricted caller-provided diagnostic text. The free-form `error_reason` is not validated, length-limited, or mapped to a predefined code. It can therefore contain exception details, user input, internal paths, tokens, or other sensitive information supplied by an upstream caller. The phone number is also unnecessary if the cloud order number already identifies the affected account. ### Attack Path 1. A payment attempt fails or a caller invokes `payment_fail_callback()`. 2. The caller supplies an order ID, phone number, and arbitrary error text. 3. The function serializes all three fie ...[truncated 496 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (200)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个可执行的支付与账户增值技能,但实际代码仅是一个被禁用的旧支付入口占位文件,启动后立即抛出 SystemExit 并退出。它没有执行充值、续费、查询、余额检查、套餐展示或支付页面生成等功能。虽然代码内容与支付领域相关,但其当前主行为是“禁用旧入口并提示改用云端下单流程”,与声明中的完整业务能力明显不符,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个可实际提供账户增值、查询和支付宝支付流程的技能;但提供的代码片段没有实现这些功能,而是通过抛出 SystemExit 明确禁用了旧版真实支付宝支付入口。其实际主用途是阻止运行,而非处理支付或账户服务。因此,代码行为与声明用途存在显著不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的核心能力是支付与账户管理流程,但代码实际只处理 ApiKey 的提取、持久化和提示展示。这不是支付页面生成、支付宝集成、账户余额/使用次数查询、充值续费处理的支撑细节,而是明显不同的主功能。同时,代码访问的资源是本地工作区 data/smyx-api-key.txt 文件,而声明未提及任何 ApiKey 管理或本地凭据存储行为。因此描述与实际行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个完整的支付与账户增值技能,但提供的代码片段只是一个不可用的旧入口包装器,唯一行为是抛出 SystemExit 并输出说明文字。它既没有执行业务逻辑,也没有访问支付、账户或套餐相关资源。代码的实际目的更像是阻止使用旧流程,而不是完成所声明的支付/查询能力,因此属于明显的描述与行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description claims a full payment skill handling充值/续费、账户查询、余额检查、支付宝支付集成和支付页面生成, plus mandatory package-list presentation. However, the provided code chunk does none of that. It is a security-disabled legacy script for checking order status and immediately terminates via SystemExit with a message saying the old order-query entry is disabled. This is a material mismatch between declared purpose and actual behavior of the supplied code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a broad payment skill: account top-up/renewal, balance and usage queries, payment handling, Alipay integration, and package presentation requirements. The actual code chunk does none of these things. It contains only a hard-disabled script for an old payment-status query path and exits immediately. This is a materially different primary purpose from the declared skill behavior, so the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

描述与代码仅部分重合。代码确实包含账户查询、充值订单创建和支付宝回调等支付相关接口,但这些功能是示例化/占位式实现;同时代码核心结构和主要实现内容集中在认证系统(require_auth、login、refresh、logout、token stats)。更重要的是,声明中的强制要求——每次展示套餐列表必须完整显示套餐1-4及专属定制套餐——在代码中没有任何对应逻辑,既没有套餐列表接口,也没有展示逻辑。此外,代码还执行了未声明的认证与Token管理能力。综合来看,实际行为与声明的主要用途存在实质偏差,应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description focuses on a payment skill for充值/续费, account status/balance/use-count queries, and strict package-list presentation requirements. The code only shows configuration, not full behavior, but from what is visible there is a material mismatch: the quantity query URL is overwritten to '/web/ai-analysis/get-common-ai-analysis-result', which appears to target common AI analysis results rather than payment account balance or usage counts. While the create-order and Alipay notify endpoints align with payment integration, the visible query behavior does not match the declared account-query purpose. Additionally, the strong declared requirement to always display package plans 1–4 is not reflected anywhere in this code chunk. Therefore the supplied code does not accurately represent the full declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

代码的核心确实与声明的支付/充值场景高度相关:它会创建充值订单、集成支付宝支付、生成支付页面,并在支付成功后查询余额,因此大方向属于‘账户增值/支付集成’范畴。不过,声明中一个非常突出的强制性要求是每次展示套餐列表时必须完整显示套餐1-4并包含专属定制套餐,而此代码根本没有任何套餐列表展示逻辑,只接受外部传入的单个 package-name/amount/uses 参数并展示该单一套餐。因此声明中的一个关键功能要求未被代码支持。其次,声明把账户查询、余额检查列为可用能力,但本代码不提供独立账户查询入口,仅在检测到支付成功后调用 query_account 以更新展示结果。最后,代码还实现了嵌入页面托管、status.json 轮询和支付结果监控,这是比‘支付页面生成’更具体的行为,虽属相关扩展,但声明未清晰覆盖。综合来看,代码与描述部分一致,但存在重要功能缺失与能力表述不准确,构成描述与实际行为不完全匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

声明描述的是面向用户的完整支付/账户增值技能,涵盖充值续费、账户状态查询、余额检查、支付宝集成与支付页面生成,还包含强制性的套餐展示要求。实际代码则只是一个调试脚本:生成一个虚拟订单,构造支付宝收银台URL,输出说明文本,并打印一个用于触发其他支付技能的JSON片段。它没有连接任何账户系统、没有查询余额或使用次数、没有校验账户状态、没有展示任何套餐列表,也没有真正处理充值续费业务逻辑。虽然‘生成支付宝支付链接’与声明中的一小部分能力一致,但代码的主要用途明显是测试/调试支付宝支付触发流程,因此与声明的整体功能存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

声明描述的是一个面向实际技能账户充值与查询的支付技能,并且有明确的强制要求:每次展示套餐列表时必须完整显示套餐1-4,包括专属定制套餐。实际代码只是一个演示性质脚本,使用 MOCK_ACCOUNT 进行模拟查询,随后展示充值金额 [10,50,100,500],并没有实现或展示声明中要求的套餐1-4与专属定制套餐。此外,代码没有体现续费流程,账户查询和支付回调也都是演示/模拟性质。虽然代码与“支付宝支付集成、账户查询、余额检查、充值流程”大方向相关,但其实际行为与声明的完整能力范围及关键展示要求存在明显不一致,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

声明覆盖的能力范围明显大于该代码片段实际行为。代码的主功能是“充值流程演示”和支付宝下单/二维码生成,这与声明中的一部分(充值、支付宝支付集成)一致;但声明还强调账户查询、余额检查、续费、支付页面生成,以及必须完整展示1-4套餐含定制套餐。该片段没有任何查询余额/使用次数或续费逻辑,也没有真正生成支付页面,只是生成二维码图片。此外,代码只是遍历 get_recharge_packages() 返回结果,无法从片段中确认一定包含并完整展示1-4套餐及定制套餐。因此描述对该代码片段而言存在明显功能性夸大与不完全对应。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

声明描述的是一个较完整的账户增值/查询/支付技能,包含充值续费、账户状态查询、余额检查、支付集成及套餐展示要求。但提供的代码片段仅执行真实支付宝订单创建和支付页打印,属于支付流程中的一个演示环节。它没有实现账户余额或使用次数查询,也没有任何套餐列表逻辑,更没有体现“必须完整显示套餐1-4”的核心描述要求。因此,代码行为只覆盖了声明中的一小部分(支付宝支付页面生成/支付集成),整体上与声明的主要功能集合不一致,属于能力缺失型不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

声明描述的是一个完整的支付/账户增值技能,而实际代码片段只是一个安全限制脚本,用于阻止在本地生成或保存支付宝私钥,并提示应使用云端 create_order 返回的 privateKey 在内存中完成签名。该代码的主要行为与声明的核心能力严重不符。虽然它与支付宝支付安全实践相关,可能属于支付系统的辅助约束,但单独看此代码并未实现描述中的主要功能,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a functional payment/account service with recharge, renewal, balance checks, account queries, package display behavior, and Alipay/payment-page generation. The actual code chunk does none of those things: it contains only a docstring saying the old payment-link generation entry has been disabled and then immediately raises SystemExit. This is a material mismatch in primary purpose and implemented capabilities. There are no extra undeclared sensitive behaviors, but the described capabilities are absent from the provided code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a broader account payment skill covering recharge/renewal, account lookup, balance checking, package presentation, Alipay integration, and payment page generation. The supplied code chunk only implements a narrow test utility: it creates one hardcoded Alipay order for ¥0.01, generates a QR code image, and prints instructions for paying/querying the order. While this is related to the declared Alipay payment integration aspect, it does not implement the main declared account-service capabilities such as querying balances/usage, checking account status, or showing the full package list with the mandatory custom package. Therefore the description materially overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向用户的支付与账户增值技能,核心能力应包括充值、续费、账户状态查询、支付宝支付和套餐展示。实际代码却是一个底层身份解析模块,主要职责是确定内部充值账户:从 workspace 中读取 smyx-api-key.txt、将 API key 注入共享请求层、从本地数据库按 API key 反查 username、或创建默认本地 User_xxx 账户。虽然这可能是支付流程的支撑组件,但就该代码块本身而言,其行为与声明的主要功能明显不一致;尤其是声明中的支付、查询、套餐展示等核心能力在代码中均未出现。此外,代码还访问本地 API key 文件并处理内部身份映射,这属于描述未提及的资源访问与能力。因此应判定为描述与代码行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个覆盖充值、续费、账户查询、支付宝支付集成和支付页面生成的完整支付技能,还包含关于套餐列表展示的强制要求。但该代码片段仅执行以下行为:1)阻塞等待指定秒数;2)调用支付宝订单状态查询接口;3)格式化并返回订单支付状态;4)在支付成功且显式启用时查询账户余额。虽然这与声明中的“账户查询/余额检查”“支付流程的一部分”存在部分重叠,但核心实现更窄,且当前代码的主职责是订单状态检查,而不是综合支付/账户增值技能。尤其是描述中强调的套餐展示、充值/续费、支付页面生成,在代码中完全没有体现,因此描述与该代码片段的实际行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个完整的支付与账户增值技能,但实际代码片段并未执行任何支付、充值、续费、余额查询或套餐展示相关功能。该脚本的唯一行为是直接终止运行,并说明“当前流程不自动查单”。这与声明中的核心用途存在实质性差异,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个可执行的支付与账户服务技能,但实际代码仅是一个被安全加固后禁用的脚本:导入即直接 SystemExit,并附带禁用说明。其主要行为是阻止旧版本地支付流程运行,而不是提供所宣称的支付、查询或展示能力。因此描述与代码实际行为存在明显且实质性的目的不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个较完整的“技能账户增值”能力,包括账户余额/使用次数查询、充值续费流程、套餐展示约束和支付宝支付集成。而实际代码块只覆盖支付链路中的一部分:使用云端返回的支付宝私钥生成当面付二维码、H5支付链接,以及查询支付宝交易状态。它没有看到任何技能账户数据读写、余额检查、账户续费、生效次数更新、套餐1-4展示逻辑或专属定制套餐处理。因此,描述明显宽于且不同于代码实际行为,属于实质性描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

代码与声明部分重合:它确实支持充值订单创建、支付宝支付集成和支付页面/二维码生成,也包含查询支付状态与余额的辅助逻辑。但存在重要不一致。首先,声明中的强制要求是每次展示套餐列表必须完整展示套餐1-4及定制套餐,而该代码根本没有任何套餐列表展示逻辑,无法满足该显式承诺。其次,从主入口 create_order_and_show_payment_with_status 来看,实际主要用途是“生成支付信息并提示后续手动查询余额”,并非完整实现声明中的账户查询、余额检查与支付后状态处理。虽然文件内有 _query_status_and_balance 辅助函数,但它不在主流程中被调用,且注释明确说明‘不自动查询订单状态或余额’。因此,实际行为相较声明更窄,且遗漏了声明中的关键展示要求,构成描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-behavior mismatch. The declared purpose centers on a payment/account service skill with recharge, renewal, balance/status queries, Alipay integration, and package presentation requirements. The supplied code instead performs runtime platform identification and chooses a QR code output format ( vs MEDIA:) based on environment characteristics. While QR-code rendering could be a supporting detail for payments in a broader system, this chunk’s primary function is platform detection and rendering adaptation, not payment/account operations. It also accesses environment variables and the current working directory, which are not reflected in the declared purpose. Therefore this code chunk does not accurately represent the stated skill behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a full payment and account-management skill. However, the provided code chunk does not implement any of those capabilities. It only contains a short script whose sole effect is to terminate execution with a deprecation/security-hardening message about disabling an old notify URL test script. This is a materially different primary purpose from the declared payment service, so the description does not accurately represent the actual code behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Based on the provided code chunk alone, the implementation is effectively a minimal wrapper class with imports and inheritance. The declared description promises concrete payment-related capabilities and a mandatory package-listing behavior, but none of those behaviors are present or verifiable in this snippet. While inherited classes may implement some features elsewhere, this supplied code chunk itself does not accurately represent the declared functionality. Therefore, this is a description-behavior mismatch for the code chunk provided.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.install_untrusted_source

Install source points to URL shortener or raw IP.

Warn
Code
suspicious.install_untrusted_source
Location
skills/smyx_common/scripts/config-dev.yaml:2