T09 · Insecure Skill Coding Practices
- Location
scripts/lib/commerce_client.py:23- Finding
Remote Plaintext HTTP Endpoints Can Bypass Transport Security Validation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real commerce-agent client, but it needs Review because it handles passwords, tokens, profile data, and orders while containing concrete credential-transport and local credential-safety weaknesses.
Use this only with commerce backends you trust, and avoid entering real passwords until the URL validation, redirect handling, and credential-file creation issues are fixed. Expect it to store per-store tokens and visitor IDs under `~/.openclaw/credentials/agent-commerce-engine/`, and remember that `create-order` can submit shipping details and create a pending order even though final payment is handed back to you.
scripts/lib/commerce_client.py:23Remote Plaintext HTTP Endpoints Can Bypass Transport Security Validation
scripts/lib/commerce_client.py:73Cross-Origin Redirects May Disclose Authentication Headers and Sensitive Request Bodies
scripts/lib/commerce_client.py:49Legacy Credential Migration Allows Filesystem Path Traversal
scripts/commerce.py:35Passwords Are Exposed Through Command-Line Arguments
scripts/lib/commerce_client.py:89Credential and Visitor Files Are Not Created Atomically with Restrictive Permissions
SERVER_SPEC.md:115Untrusted Commerce Backends Can Inject Agent-Directed Instructions
README.md:27Runtime Dependency Is Installed Without Version or Integrity Pinning
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- **Types**: `story`, `company`, `contact`.
### D. Shopping Cart
`GET /cart` | `POST /cart` | `PUT /cart` | `DELETE /cart`
- **Request Body**: `{ "product_slug": string, "variant": string, "quantity": number }`.
- **Response**: Return the full cart snapshot including `totalPrice`, `currency`, and `items` (each item should also carry its `currency`).
- **Error Codes**: `PRODUCT_NOT_FOUND`, `VARIANT_UNAVAILABLE`, `BAD_REQUEST`.
The description understates several sensitive behaviors, including persistent credential storage, visitor tracking identifiers, registration flows, and order creation. When a skill performs materially more than its high-level description suggests, users and hosting platforms may grant trust or permissions without understanding the privacy and transaction risks.
The description understates several sensitive behaviors, including persistent credential storage, visitor tracking identifiers, registration flows, and order creation. When a skill performs materially more than its high-level description suggests, users and hosting platforms may grant trust or permissions without understanding the privacy and transaction risks.
The skill advertises capabilities that imply shell, network access, environment-variable use, and local credential storage, but it does not declare an explicit tool scope such as permissions or allowed-tools. That omission weakens security review and runtime containment because consumers cannot easily determine or restrict what the skill may access before use.
The skill explicitly supports account access, cart continuity, order creation, and elsewhere documents local persistence of tokens and visitor identifiers. Session persistence for commerce accounts increases exposure if the host is shared, compromised, or if domain separation is weak, because persisted tokens can enable unauthorized account or order actions without reauthentication.
# Standard Agentic Commerce Engine
The **Standard Agentic Commerce Engine** is a standard client and protocol guide for connecting agents to compatible e-commerce backends. It gives agents a consistent way to search products, manage carts, access account data, create orders, and hand payment back to the user.
GitHub Repository: https://github.com/NowLoadY/agent-commerce-engine
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Target a store directly via --store (preferred)
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 list --page 1 --limit 20
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 search "item"
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 add-cart <slug> --variant <variant_id>
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Target a store directly via --store (preferred)
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 list --page 1 --limit 20
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 search "item"
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 add-cart <slug> --variant <variant_id>
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Target a store directly via --store (preferred)
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 list --page 1 --limit 20
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 search "item"
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 add-cart <slug> --variant <variant_id>
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Target a store directly via --store (preferred)
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 list --page 1 --limit 20
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 search "item"
python3 scripts/commerce.py --store https://api.yourbrand.com/v1 add-cart <slug> --variant <variant_id>
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Global argument: --store for multi-merchant targeting
parser.add_argument("--store", metavar="URL",
help="Target store API URL (e.g., https://api.yourstore.com/v1). "
"Overrides COMMERCE_URL env var.")
subparsers = parser.add_subparsers(dest="command", help="Command type")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Global argument: --store for multi-merchant targeting
parser.add_argument("--store", metavar="URL",
help="Target store API URL (e.g., https://api.yourstore.com/v1). "
"Overrides COMMERCE_URL env var.")
subparsers = parser.add_subparsers(dest="command", help="Command type")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Global argument: --store for multi-merchant targeting
parser.add_argument("--store", metavar="URL",
help="Target store API URL (e.g., https://api.yourstore.com/v1). "
"Overrides COMMERCE_URL env var.")
subparsers = parser.add_subparsers(dest="command", help="Command type")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Global argument: --store for multi-merchant targeting
parser.add_argument("--store", metavar="URL",
help="Target store API URL (e.g., https://api.yourstore.com/v1). "
"Overrides COMMERCE_URL env var.")
subparsers = parser.add_subparsers(dest="command", help="Command type")
The code defines a clear-cart command that removes the entire shopping cart, which is a destructive operation affecting user data. There is no visible confirmation prompt, cautionary help text, or other user-facing warning near the command definition or execution path.
The logout command invokes client.delete_credentials(), which appears to remove locally stored authentication material. Although a success message is printed after the fact, there is no prior disclosure or confirmation that credentials will be deleted.
The method persists account and API token data to a local credentials file, which is a safety-relevant file write involving sensitive data. Although there is an internal docstring/comment, there is no user-facing disclosure, confirmation, or visible warning in this code path that credentials will be stored on disk.
This method deletes the stored credentials file, which is a destructive local file operation affecting authentication state. The code provides no visible confirmation prompt, user disclosure, or warning that saved credentials will be removed.
The manifest describes support for discovery, cart operations, and secure user management, which clearly covers authentication/profile handling, but this file also exposes email verification-code sending and full account registration flows. Those onboarding capabilities materially expand the skill from managing existing user sessions into creating new user accounts, which is not stated in the manifest description.
Legacy credential migration is keyed off a caller-supplied brand_id rather than the actual domain identity, which can cause credentials from one logical merchant context to be moved into another domain's storage directory. In a multi-merchant agent environment, this risks cross-tenant credential confusion or accidental disclosure if an attacker can influence brand_id selection.
Several comments and docstrings in this file are written in Chinese, which imposes a specific language in natural-language content embedded in the skill code. The file does not indicate that language choice is configurable or justified as a region-specific requirement.
The method removes the existing visitor file and creates a new visitor ID, altering persisted local session/cart linkage data. While the comment explains the purpose to developers, there is no user-facing disclosure that local cart/session identity may change as a result.
No suspicious patterns detected.