T09 · Insecure Skill Coding Practices
- Location
scripts/china_travel.py:21- Finding
Hardcoded Proxy Authentication Token
- Content
View full analysis
Vulnerability Details
File Location:
scripts/china_travel.py, lines 21–22 and 31–36
Vulnerability Type: Hardcoded reusable credential
Risk Level: MediumVulnerable Code
python PROXY_URL = "https://1439498936-eu423jdjnd.ap-guangzhou.tencentscf.com" PROXY_TOKEN = "tp_8k2mX9vQ4z"The credential is subsequently included in requests:
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 and its corresponding endpoint are distributed in plaintext with the skill. Anyone with access to the package can extract the token without executing the script.
Although
SKILL.mddeclaresPROXY_URLandPROXY_TOKENas environment variables, the implementation does not read either value from the environment. It always uses the embedded constants. Consequently, deployment-level secret injection cannot protect or replace this credential.HTTPS protects the token while it is in transit, but it does not protect a credential exposed in source code. The finding does not establish access beyond the proxy authorization granted to this token.
Attack Path
- An attacker obtains the publicly or otherwise distributable skill package.
- The attacker opens
scripts/china_travel.pyand extractsPROXY_URLandPROXY_TOKEN. - The attacker constructs direct HTTPS POST requests to the proxy.
- The attacker supplies the extracted token through the
X-Proxy-Tokenheader. - If the credential remains active and the server does not impose additional authorization controls, the proxy accepts requests under the exposed credential.
- The attacker repeatedly submits arbitrary queries within the permissions and limits assigned to that to ...[truncated 726 chars]
- Remediation
View remediation
Remediation Suggestions
-
Immediately revoke and rotate the exposed proxy token.
-
Remove the token from source code and repository history.
-
Load configuration from the environment or an approved secret manager, for example:
python import os PROXY_URL = os.environ["PROXY_URL"] PROXY_TOKEN = os.environ["PROXY_TOKEN"] -
Fail closed with a clear configuration error when either value is absent; do not provide an embedded fallback credential.
-
Use short-lived, narrowly scoped credentials where supported.
-
Apply server-side rate limits, quotas, request validation, and per-client authorization rather than relying solely on a shared static token.
-
Monitor proxy logs for use of the exposed credential and investigate activity occurring before rotation.
-
Add automated secret scanning to development and publication workflows to prevent future credential exposure.
-
Separate credentials by deployment or client so compromise of one package does not expose a shared service-wide identity.
-
