T09 · Insecure Skill Coding Practices
- Location
scripts/service.py:63- Finding
Payment Authorization Can Be Forged Through a Locally Writable Order File
- Content
View full analysis
bool: credential = order_data.get("payCredential") if not credential: return False credential_ts = order_data.get("credentialTimestamp") if credential_ts and time.time() - credential_ts > CREDENTIAL_TTL: return False return True ``` ```python pay_status = order_data.get("payStatus", "SUCCESS") ``` ### Technical Analysis The service treats any nonempty `payCredential` value as proof of payment. It does not verify a digital signature, message authentication code, expected credential format, issuer, order number, amount, recipient, or indicator. The expiration check is also optional. If `credentialTimestamp` is absent, the credential is considered current regardless of its age. In addition, an absent `payStatus` field defaults to `SUCCESS`. Because order files are stored under the current user's home directory and are writable by that user, a caller can directly modify the JSON record and satisfy every authorization condition without completing payment. ### Attack Path 1. Run `scripts/create_order.py` to create a legitimate local order file. 2. Locate the resulting file under `~/.openclaw/skills/orders/{indicator}/{order_no}.json`. 3. Add an arbitrary nonempty value such as: ```json { "payCredential": "forged" } ``` 4. Omit `credentialTimestamp`, preventing the expiration condition from being evaluated. 5. Omit `payStatus`, causing the service to use its default value of `SUCCESS`. 6. Run `python3 scripts/service.py `. 7. The script returns `AUTHORIZATION_RESULT=verified` without cryptographically verifying payment. ### Impact Assessment An unprivileged local user who can create or edit their own order file can completely bypass the paym ...[truncated 246 chars]- Remediation
View remediation
