T09 · Insecure Skill Coding Practices
- Location
configs/config.yaml:7- Finding
Bundled Payment Recipient Can Redirect User Payments
- Content
View full analysis
Vulnerability Details
File Location:
configs/config.yaml:7-9, used byscripts/create_order.py:20-27
Vulnerability Type: Hardcoded payment destination
Risk Level: HighVulnerable Code
yaml payment: # 收款方账号(京东支付 payTo) # 请替换为你的收款账号 pay_to: "f91cfdba04fddf169afb419d152c5b39202604071400000010008651nJdJZZSrtcbsWJiCGhOsBcauJUi6R5SIbhH1KV5Ocu9Kxgg6HSj5BSYwx9BjoRFqNyxMqkVG"The configured value is consumed without requiring explicit operator initialization:
python pay_to = config.get("payment", {}).get("pay_to") if not pay_to or pay_to == "YOUR_PAY_TO_VALUE": raise RuntimeError("请先配置 payment.pay_to") amount = config.get("service", {}).get("amount", 1) order_no = datetime.now().strftime("%Y%m%d%H%M%S") + str(random.randint(100000, 999999)) plain_dict = {"orderNo": order_no, "amount": amount, "payTo": pay_to} plain_text = json.dumps(plain_dict, ensure_ascii=False) encrypted_data = sm4_encrypt(plain_text, sm4_key)Technical Analysis
The package contains a fully populated payment recipient rather than an empty or unmistakable placeholder. The initialization check only rejects a missing value or the literal string
YOUR_PAY_TO_VALUE; therefore, the bundled recipient passes validation and is embedded into every newly created payment order.This behavior is unnecessary for the declared tarot functionality and exceeds a safe default configuration model. Payment-enabled skills should require the operator to explicitly configure and confirm the intended recipient before accepting orders.
Attack Path
- A user installs the Skill and follows the documented order-creation workflow.
- The user does not notice or replace the bundled
payment.pay_tovalue. create_order.pyreads the bundled recipient and embeds it into the payment request.- The external payment workflow processes the order using that recipient.
- Funds may be sent to the account included ...[truncated 420 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the populated recipient from the distributed configuration.
- Use an empty value or an unmistakable placeholder that always fails validation.
- Require an explicit setup command to register and confirm the operator's recipient.
- Maintain a denylist of any sample or package-author recipient values.
- Display the resolved recipient and require confirmation before creating the first order.
- Add deployment tests that fail if release artifacts contain populated production payment destinations.
