T09 · Insecure Skill Coding Practices
- Location
scripts/main.py:11- Finding
Hardcoded Proxy Authentication Token
- Content
View full analysis
Vulnerability Details
File Location:
scripts/main.py, line 11
Vulnerability Type: Hardcoded reusable authentication secret
Risk Level: Mediumpython PROXY_TOKEN = os.environ.get("PROXY_TOKEN", "tp_8k2mX9vQ4z")Technical Analysis
The source code contains a reusable proxy authentication token as the default value for
PROXY_TOKEN. Although the environment can override this value, the embedded credential is used whenever the variable is absent. Any party with access to the distributed skill can recover the token without executing the code.The token is subsequently placed in the
X-Proxy-Tokenheader of requests sent to the public proxy endpoint. This creates a credential-disclosure and unauthorized-use risk because possession of the packaged source is sufficient to obtain the default credential.Attack Path
- An attacker downloads the skill package or otherwise reads
scripts/main.py. - The attacker extracts the hardcoded proxy token and the public proxy URL.
- The attacker constructs direct HTTPS requests to the proxy and supplies the token through the
X-Proxy-Tokenheader. - If the server accepts the exposed token, the attacker submits unauthorized proxy requests independently of the skill.
- The attacker can continue consuming proxy-backed resources until the credential is revoked, expires, or is blocked by server-side controls.
Impact Assessment
Successful exploitation may permit unauthorized use of the proxy-backed product-search service. The practical scope can include API quota consumption, resource-cost increases, abusive traffic, and reduced availability for legitimate users.
No evidence establishes that this token grants local system privileges, access to end-user accounts, or arbitrary code execution. The exact server-side permissions cannot be determined from the audited repository and depend on the proxy's authorization controls.
- An attacker downloads the skill package or otherwise reads
- Remediation
View remediation
Remediation Suggestions
- Remove the hardcoded fallback and require the credential at runtime:
python PROXY_TOKEN = os.environ.get("PROXY_TOKEN") if not PROXY_TOKEN: raise RuntimeError("PROXY_TOKEN is required") - Immediately revoke and rotate the exposed token.
- Store credentials in an approved secret manager or protected runtime configuration rather than source code or distributed packages.
- Issue separate, short-lived, narrowly scoped credentials per user or installation instead of sharing a global token.
- Enforce server-side authorization, expiration, rate limits, quotas, request validation, and abuse monitoring.
- Review proxy logs for unexpected use of the exposed credential and invalidate associated sessions or derived credentials where applicable.
- Add automated secret scanning to development and release pipelines to prevent future credential publication.
- Remove the hardcoded fallback and require the credential at runtime:
