T09 · Insecure Skill Coding Practices
- Location
scripts/check_balance.py:58- Finding
API Credential Transmitted in a URL Over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/check_balance.py:6andscripts/check_balance.py:58-62
Vulnerability Type: Plaintext transmission and URL exposure of sensitive credentials
Risk Level: HighVulnerable Code
python BALANCE_API_URL = "http://v2api.aicodee.com/chaxun/balance"python url = f"{BALANCE_API_URL}?key={api_key}" try: req = urllib.request.Request(url) with urllib.request.urlopen(req, timeout=10) as response:The insecure endpoint is also explicitly documented at
SKILL.md:25:markdown - Balance query endpoint: `http://v2api.aicodee.com/chaxun/balance?key={api_key}`Technical Analysis
The skill reads an API key from the user's OpenClaw configuration and includes it in the query string of an unencrypted HTTP request. HTTP provides no transport encryption or server authentication, allowing an attacker with visibility or control over the network path to inspect and modify the request.
Placing the credential in the URL creates additional exposure because complete URLs may be retained by HTTP proxies, gateways, monitoring systems, server access logs, or debugging infrastructure. The explicit
http://scheme also permits an active man-in-the-middle attacker to alter the returned balance information without detection.Attack Path
- A user invokes the balance-checking skill on an untrusted or compromised network.
- The script reads the JisuAI API key from
~/.openclaw/openclaw.json. - It constructs an HTTP URL containing the key as
?key={api_key}. - A network observer, malicious access point, compromised proxy, or other on-path attacker captures the plaintext request.
- The attacker extracts the API key from the URL.
- The attacker reuses the credential against provider endpoints accessible with that key.
- An active attacker may additionally modify the balance API response, causing the skill to display attacker-con ...[truncated 539 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace the plaintext endpoint with a verified HTTPS endpoint and validate its certificate using the platform's normal certificate-validation behavior.
-
Do not silently fall back or redirect from HTTPS to HTTP. Explicitly reject any final response URL using an insecure scheme.
-
If supported by the provider, transmit the API key in an authorization header rather than in the query string, for example:
python BALANCE_API_URL = "https://v2api.aicodee.com/chaxun/balance" req = urllib.request.Request( BALANCE_API_URL, headers={"Authorization": f"Bearer {api_key}"}, ) -
If the provider only supports query-string authentication, require HTTPS and ensure application, proxy, and server logging policies redact the
keyparameter. Avoid invoking the service until a securely authenticated HTTPS interface is available. -
Update
SKILL.mdso its documented endpoint and authentication method match the hardened implementation. -
Rotate all API keys previously used by this implementation because they may already have been exposed through network interception or URL logging.
-
Consider restricting the replacement key to the minimum required API operations, quota, and account permissions.
-
