T09 · Insecure Skill Coding Practices
- Location
scripts/china_travel.py:24- Finding
Hardcoded Proxy Authentication Token
- Content
View full analysis
Vulnerability Details
File Location:
scripts/china_travel.py, lines 24–25 and 34–39
Vulnerability Type: Hardcoded reusable authentication credential
Risk Level: HighVulnerable Code
python PROXY_URL = "https://1439498936-eu423jdjnd.ap-guangzhou.tencentscf.com" PROXY_TOKEN = "tp_8k2mX9vQ4z"python req = urllib.request.Request( PROXY_URL, data=data, headers={ "Content-Type": "application/json", "X-Proxy-Token": PROXY_TOKEN, "User-Agent": "ChinaTravel/2.0", }, method="POST" )Technical Analysis
A reusable proxy authentication token is embedded directly in distributed source code and sent in the
X-Proxy-Tokenrequest header. Anyone with access to the Skill package can recover both the service endpoint and credential without executing the script.Although
SKILL.mddeclaresPROXY_URLandPROXY_TOKENas environment variables, the implementation does not read them. It always uses the hardcoded values. HTTPS protects the token while in transit but does not mitigate its disclosure in source code.An attacker can use the exposed credential outside the intended Skill workflow to submit authenticated requests directly to the proxy. The exact server-side authorization scope cannot be determined from the audited files, so access beyond what the proxy grants to this token is not established.
Attack Path
- Download or otherwise obtain the published Skill package.
- Inspect
scripts/china_travel.py. - Extract the fixed Tencent SCF endpoint and
PROXY_TOKEN. - Construct an HTTPS POST request to the endpoint with the stolen value in the
X-Proxy-Tokenheader. - Submit attacker-controlled JSON requests using the exposed proxy authorization.
- Continue using the credential until it is revoked, rotated, rate-limited, or rejected by the server.
Impact Assessment
Successful exploitation may allow unauthorized use of the proxy and its downstream TripGenie API access. Potent ...[truncated 611 chars]
- Remediation
View remediation
Remediation Suggestions
- Immediately revoke and rotate the exposed token; removing it from the source alone is insufficient because published copies may retain it.
- Load configuration from environment variables as declared in
SKILL.md, and fail closed if either value is missing:
python import os PROXY_URL = os.environ.get("PROXY_URL") PROXY_TOKEN = os.environ.get("PROXY_TOKEN") if not PROXY_URL or not PROXY_TOKEN: raise RuntimeError("PROXY_URL and PROXY_TOKEN must be configured securely")- Supply the token through the platform’s secret-management facility rather than source files, package metadata, command-line arguments, or logs.
- Restrict the replacement token to the minimum necessary proxy operations and downstream API scope.
- Apply server-side rate limits, request validation, quotas, expiration, and credential rotation.
- Monitor proxy logs for use of the disclosed token and investigate anomalous requests, quota consumption, and affiliate activity.
- Prevent recurrence with secret scanning in pre-commit hooks and CI/CD, including repository history and packaged release artifacts.
- Consider replacing static shared tokens with short-lived, per-installation or per-session credentials where supported.
