T09 · Insecure Skill Coding Practices
- Location
scripts/miniflux.py:75- Finding
Miniflux API Token Can Be Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/miniflux.py:75-93
Vulnerability Type: Missing transport security enforcement for credential-bearing requests
Risk Level: HighVulnerable Code:
python def _request(path: str, query: dict | None = None, *, method: str = "GET", body: dict | None = None): base = _require("MINIFLUX_URL", "MINIFLUX_URL", "url").rstrip("/") token = _require("MINIFLUX_TOKEN", "MINIFLUX_TOKEN", "token").strip() url = base + path if query: url = url + "?" + urllib.parse.urlencode({k: v for k, v in query.items() if v is not None}) data_bytes = None if body is not None: data_bytes = json.dumps(body).encode("utf-8") req = urllib.request.Request(url, data=data_bytes, method=method) req.add_header("X-Auth-Token", token) req.add_header("Accept", "application/json") if data_bytes is not None: req.add_header("Content-Type", "application/json") try: with urllib.request.urlopen(req, timeout=30) as resp: data = resp.read()Technical Analysis
The Miniflux base URL is read from user-controlled configuration or the
MINIFLUX_URLenvironment variable and used without validating its URL scheme. The code then places the Miniflux API token in theX-Auth-Tokenrequest header.Although the documentation uses HTTPS in its examples, the implementation accepts an
http://URL. When HTTP is used, neither the authentication header nor the response is protected by TLS. A network observer or active man-in-the-middle attacker can therefore capture the token and inspect or alter Miniflux API traffic.Sending the token to the configured Miniflux API is necessary for the declared functionality. The security issue is not the network operation itself, but the absence of enforcement ensuring that the credential is transmitted through a secure transport.
Attack Path
- The victim conf ...[truncated 1178 chars]
- Remediation
View remediation
Remediation Suggestions
- Parse the configured base URL with
urllib.parse.urlparse()before constructing a request. - Reject every scheme except
httpsby default. - If plaintext HTTP is required for local development, permit it only for loopback destinations such as
127.0.0.1,::1, orlocalhost, and only behind an explicit option such as--allow-insecure-http. - Reject URLs containing embedded credentials or unexpected components.
- Ensure authentication headers are not forwarded to a different origin during redirects. Prefer disabling redirects for authenticated API calls or validating that every redirect retains the original HTTPS scheme, hostname, and port.
- Update
SKILL.mdto state that HTTPS is mandatory rather than merely showing HTTPS in examples. - Use a dedicated Miniflux token with only the minimum permissions needed by the intended commands, and rotate any token suspected of having been transmitted over HTTP.
- Parse the configured base URL with
