T09 · Insecure Skill Coding Practices
- Location
scripts/main.py:10- Finding
Hard-Coded Proxy Authentication Token
- Content
View full analysis
Vulnerability Details
File Location:
scripts/main.py, line 10
Vulnerability Type: Hard-coded reusable authentication credential
Risk Level: HighVulnerable Code
python PROXY_TOKEN = os.environ.get("PROXY_TOKEN", "tp_8k2mX9vQ4z")The credential is subsequently used as an authentication header:
python req = urllib.request.Request( PROXY_URL, data=body, method="POST", headers={"Content-Type": "application/json", "X-Proxy-Token": PROXY_TOKEN}, )Technical Analysis
The source code includes a reusable proxy authentication token as the default value of
PROXY_TOKEN. If the environment variable is absent, every installation uses this embedded credential when sending requests to the configured cloud proxy.Anyone able to download or inspect the skill package can recover the token without executing the code. HTTPS protects the credential while it is transmitted but does not mitigate disclosure from the distributed source. The exposed token can then be placed in the
X-Proxy-Tokenheader of independently constructed requests.The exact server-side permissions and rate limits associated with the token are not visible in the audited files. Therefore, the maximum impact depends on the proxy's authorization controls and must be verified server-side.
Attack Path
- An attacker downloads or otherwise obtains access to the skill package.
- The attacker inspects
scripts/main.pyand extracts the defaultPROXY_TOKEN. - The attacker identifies the default proxy endpoint declared in the same file.
- The attacker constructs HTTP POST requests containing the recovered token in the
X-Proxy-Tokenheader. - The proxy accepts those requests as authenticated if the token remains active.
- The attacker repeatedly invokes the service within the token's permissions and any applicable server-side limits.
Impact Assessment
Successful exploitation can permit unauthorized use of the cloud proxy under the shared credent ...[truncated 591 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the embedded fallback credential and fail securely when the secret is unavailable:
python PROXY_TOKEN = os.environ.get("PROXY_TOKEN") if not PROXY_TOKEN: raise RuntimeError("PROXY_TOKEN must be provided through secure runtime configuration")- Immediately revoke and rotate the exposed token because removal from future releases does not invalidate copies already distributed.
- Store the replacement credential in a managed secret store or protected runtime environment rather than source code, documentation, package metadata, or version-control history.
- Issue separate, short-lived credentials per user, installation, or execution context instead of sharing a global static token.
- Apply least privilege so the credential can access only the required product-list operation.
- Enforce server-side rate limits, quotas, expiration, token revocation, and anomaly detection.
- Validate allowed operation names and request parameters at the proxy rather than relying solely on the client.
- Add secret-scanning checks to version control and release pipelines to prevent future credential inclusion.
- Review proxy access logs for suspicious use of the exposed token and investigate unexpected traffic or resource consumption.
