T09 · Insecure Skill Coding Practices
- Location
scripts/technitium_health_check.py:29- Finding
Bearer Token Exposure Through Plaintext HTTP and Unrestricted Redirects
- Content
View full analysis
Vulnerability Details
File Location:
scripts/technitium_health_check.py:29-31; insecure HTTP configurations are also documented atSKILL.md:19-20andSKILL.md:31-33
Vulnerability Type: Transmission of sensitive authentication credentials over an insufficiently protected network channel
Risk Level: HighVulnerable Code
python def api_get(base, token, path, params=None): qs = ('?' + urlencode(params)) if params else '' req = Request(base + path + qs, headers={'Authorization': 'Bearer ' + token}) with urlopen(req, timeout=DEFAULT_TIMEOUT) as resp: body = resp.read().decode('utf-8', errors='replace')The associated documentation explicitly permits a plaintext HTTP endpoint:
bash export TECHNITIUM_URL="http://dns-server.example:5380" export TECHNITIUM_TOKEN="..."bash TECHNITIUM_URL="http://dns-server.example:5380" \ TECHNITIUM_TOKEN="..." \ python3 /path/to/technitium-dns/scripts/technitium_health_check.pyTechnical Analysis
The script obtains a sensitive API/session token from
TECHNITIUM_TOKENand places it in an HTTPAuthorization: Bearerheader. It then sends the request to the environment-controlledTECHNITIUM_URLwithout validating the URL scheme, destination origin, or redirect chain.Because the documented examples use
http://, users may transmit the bearer token without transport encryption. An attacker able to observe or modify traffic between the monitoring host and the Technitium server could capture the token directly or manipulate the HTTP exchange.Python's
urllib.request.urlopenfollows supported redirects by default. The code does not disable redirects or independently verify that each redirect remains on the original trusted HTTPS origin. Consequently, a compromised or malicious endpoint can attempt to redirect authenticated requests toward an attacker-controlled destination.Sending the token is necessary for ...[truncated 1898 chars]
- Remediation
View remediation
Remediation Suggestions
- Require
https://for all non-loopback Technitium endpoints and reject plaintext HTTP during configuration validation. - If local plaintext HTTP support is operationally necessary, require an explicit insecure opt-in and restrict it to loopback addresses such as
127.0.0.1or::1. - Disable automatic redirects for authenticated API requests, or implement a redirect handler that only permits redirects which remain on the exact original HTTPS scheme, host, and port.
- Never forward the
Authorizationheader when the destination origin changes. - Validate
TECHNITIUM_URLusing URL parsing before constructing requests; reject unexpected schemes, embedded credentials, fragments, and untrusted origins. - Update all documentation examples to use HTTPS and clearly warn that bearer tokens must not be sent over plaintext networks.
- Replace the recommendation for non-expiring tokens with dedicated, least-privilege, revocable, and preferably time-limited monitoring tokens.
- Ensure the monitoring account can access only the read-only endpoints required by the health check.
- Support normal TLS certificate and hostname verification, and document how to deploy a trusted certificate rather than encouraging users to bypass verification.
- Rotate any token that may previously have been transmitted over plaintext HTTP.
- Require
