T09 · Insecure Skill Coding Practices
- Location
SKILL.md:143- Finding
Proxy Authentication Credentials Transmitted over Cleartext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 143-146
Vulnerability Type: Plaintext transmission of authentication credentials
Risk Level: Mediumjs const proxyAgent = new ProxyAgent({ uri: 'http://proxy:8080', token: `Basic ${Buffer.from('user:pass').toString('base64')}` });Technical Analysis
The proxy authentication example combines Basic authentication with an unencrypted
http://proxy connection. Base64 encoding is reversible and provides no confidentiality. If a user adapts this example with real credentials, the proxy authorization token may be exposed to an attacker capable of observing traffic between the client and the proxy.Authentication through a proxy is necessary for the Skill's declared proxy functionality, but transmitting reusable credentials without TLS exceeds acceptable minimum-security requirements. The example also encourages placing a username and password directly in source code, which may expose them through source control, logs, diagnostics, or copied configuration.
Attack Path
- A user copies the documented example and replaces
user:passwith valid proxy credentials. - The application connects to the configured proxy using unencrypted HTTP.
- An attacker with access to the local network, an intermediate gateway, or another on-path position captures the proxy authentication traffic.
- The attacker extracts and Base64-decodes the Basic authentication token.
- The attacker reuses the recovered credentials to authenticate to the proxy, subject to the proxy's network exposure and access controls.
Impact Assessment
Successful exploitation can disclose the proxy username and password and permit unauthorized use of the associated proxy account. The resulting scope is limited to the privileges assigned to those credentials, but it may include use of proxy resources, consumption of network quotas, access to destinations restricted to authent ...[truncated 303 chars]
- A user copies the documented example and replaces
- Remediation
View remediation
Remediation Suggestions
-
Use a TLS-protected proxy endpoint such as
https://proxy.example:8080and validate its certificate. -
Do not embed usernames or passwords directly in source code or documentation examples. Load credentials from a secret manager or protected environment variable.
-
Explicitly state that Base64 is encoding rather than encryption and that Basic credentials must not be sent over an untrusted cleartext connection.
-
Prefer short-lived, narrowly scoped proxy tokens where supported.
-
Avoid printing proxy configuration objects or authentication headers in logs.
-
Provide a hardened example, such as:
js import { ProxyAgent } from 'undici'; const proxyToken = process.env.PROXY_AUTH_TOKEN; if (!proxyToken) { throw new Error('PROXY_AUTH_TOKEN is required'); } const proxyAgent = new ProxyAgent({ uri: 'https://proxy.example:8080', token: `Bearer ${proxyToken}` }); -
Ensure the secret-bearing environment variable is injected through a protected deployment mechanism rather than committed to a repository.
-
