T09 · Insecure Skill Coding Practices
- Location
scripts/search.py:70- Finding
Proxy Credentials Exposed Through Informational Logging
- Content
View full analysis
Vulnerability Details
File Location:
scripts/search.py:70-75
Vulnerability Type: Sensitive credential exposure through logs
Risk Level: MediumVulnerable Code
python def set_proxy(proxy_url): """Set proxy for all HTTP requests (HTTP and SOCKS5 supported).""" global PROXY if proxy_url: PROXY = proxy_url logger.info(f"Proxy configured: {PROXY}")The documented command-line interface explicitly permits proxy URLs containing authentication credentials:
bash python3 scripts/search.py -q "keywords" --proxy http://user:pass@proxy:8080Technical Analysis
The complete user-supplied proxy URL is written at
INFOlevel without redacting its user-information component. When the URL contains embedded credentials, such ashttp://username:password@proxy.example:8080, both the username and password are exposed in process output.Informational logs are commonly retained by agent runtimes, CI systems, terminal recording tools, container logging drivers, and centralized monitoring services. Consequently, parties that are not authorized to use the proxy may gain access to its credentials.
The proxy is legitimately needed only when explicitly selected by the user. Logging its credentials is not necessary for the Skill's web-search functionality and exceeds the minimum disclosure required for diagnostics.
Attack Path
- A user or automation system invokes the Skill with an authenticated proxy URL:
bash python3 scripts/search.py -q "sensitive query" \ --proxy "http://user:password@proxy.example:8080" main()passes the argument toset_proxy().set_proxy()assigns the complete URL to the globalPROXYvariable.- The
logger.info()call emits the full URL, includinguser:password. - The output is captured in an agent transcript, terminal log, CI artifact, container log, or monitoring platform.
- Anyone w ...[truncated 834 chars]
- A user or automation system invokes the Skill with an authenticated proxy URL:
- Remediation
View remediation
Remediation Suggestions
- Never log a complete proxy URL that may contain credentials.
- Parse the URL and log only non-sensitive fields such as the scheme, hostname, and port.
- Replace the current logging statement with a redacted representation, for example:
python from urllib.parse import urlsplit def _redacted_proxy_url(proxy_url): parsed = urlsplit(proxy_url) host = parsed.hostname or "" port = f":{parsed.port}" if parsed.port else "" return f"{parsed.scheme}://{host}{port}" def set_proxy(proxy_url): global PROXY if proxy_url: PROXY = proxy_url logger.info("Proxy configured: %s", _redacted_proxy_url(proxy_url)) - Prefer dedicated credential inputs or environment-backed secret injection over credentials embedded in command-line arguments, because command lines may also be visible through process inspection and shell history.
- Ensure exception messages from the HTTP client cannot echo authenticated proxy URLs without redaction.
- Add automated tests confirming that proxy usernames and passwords never appear in logs.
- Rotate any proxy credentials that may already have been exposed through retained logs.
