T09 · Insecure Skill Coding Practices
- Location
scripts/main.py:16- Finding
Hard-Coded Proxy Authentication Token
- Content
View full analysis
Vulnerability Details
File Location:
scripts/main.py, line 16
Vulnerability Type: Hard-coded credential
Risk Level: MediumVulnerable Code:
python PROXY_TOKEN = os.environ.get("PROXY_TOKEN", "tp_8k2mX9vQ4z")Technical Analysis
The source code embeds a default authentication token for the remote Tencent SCF proxy. When the
PROXY_TOKENenvironment variable is absent, every installation uses this shared credential.Secrets distributed in source packages cannot be considered confidential. Any person who downloads or otherwise reads the Skill can recover the token without executing the code. The token is subsequently transmitted in the
X-Proxy-Tokenrequest header by_scf_call.Attack Path
- An attacker downloads or gains read access to the publicly distributed Skill.
- The attacker inspects
scripts/main.pyand extracts the default proxy token. - The attacker identifies the proxy URL from the adjacent configuration.
- The attacker constructs requests containing the recovered token in the
X-Proxy-Tokenheader. - If the server accepts the shared token, the attacker can access or abuse the proxy under the Skill's identity until the credential is revoked or rotated.
Impact Assessment
Successful exploitation may permit unauthorized use of the remote proxy with the same service-level authorization granted to the embedded token. The likely scope includes unauthorized API requests, quota or resource exhaustion, service disruption, and attribution of attacker traffic to legitimate Skill users.
The code does not establish that this credential provides host, operating-system, administrative, or broader cloud-account privileges. The maximum confirmed scope is therefore limited to whatever capabilities the remote proxy assigns to this token.
- Remediation
View remediation
Remediation Suggestions
- Remove the embedded fallback token and rotate the exposed credential immediately.
- Require
PROXY_TOKENto be supplied through an approved runtime secret-management mechanism. - Fail closed with a clear configuration error when the token is unavailable.
- Issue scoped, short-lived, and preferably per-user or per-installation credentials rather than a shared static token.
- Restrict each credential to the required proxy operation and enforce rate limits, expiration, revocation, and request auditing.
- Add automated secret scanning to release and CI pipelines to prevent future credential inclusion.
