T09 · Insecure Skill Coding Practices
- Location
scripts/tasks.py:24- Finding
Bearer Token and Task Data Exposure over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/tasks.py:24-45; insecure HTTP configuration is also documented inSKILL.md:15
Vulnerability Type: Transmission of sensitive information over an unencrypted channel
Risk Level: MediumVulnerable Code
python HOST = os.environ.get("TASKTROVE_HOST", "").rstrip("/") TOKEN = os.environ.get("TASKTROVE_TOKEN", "") if not HOST: print("Error: TASKTROVE_HOST environment variable is not set") print("Example: export TASKTROVE_HOST='http://localhost:3333'") sys.exit(1) API = f"{HOST}/api/v1" def _make_request(url, data=None, method="GET"): """Make an API request with optional auth.""" headers = {"Content-Type": "application/json"} if TOKEN: headers["Authorization"] = f"Bearer {TOKEN}" req = urllib.request.Request( url, data=json.dumps(data).encode() if data else None, headers=headers, method=method ) with urllib.request.urlopen(req, timeout=10) as resp: return json.load(resp)The configuration documentation also recommends a plaintext endpoint:
bash export TASKTROVE_HOST="http://your-server:3333"Technical Analysis
The CLI accepts an arbitrary
TASKTROVE_HOSTURL without validating its scheme. WhenTASKTROVE_TOKENis configured,_make_requestplaces that secret in an HTTPAuthorization: Bearerheader regardless of whether the destination uses HTTPS.Both the documentation and the missing-host error message demonstrate HTTP configurations. While loopback HTTP may be acceptable under a limited local deployment model, the documented
http://your-server:3333example encourages plaintext communication with a potentially remote server. HTTP provides neither transport confidentiality nor server authentication. A network-positioned attacker can therefore observe the bearer token and task content or tamper with requests and re ...[truncated 1481 chars]- Remediation
View remediation
Remediation Suggestions
- Require
https://wheneverTASKTROVE_TOKENis present and terminate with a clear error if an authenticated plaintext URL is supplied. - Reject remote HTTP endpoints by default. If HTTP is needed for local development, restrict it to explicit loopback destinations such as
127.0.0.1,localhost, or::1. - Provide a deliberate opt-in override for exceptional trusted development environments, accompanied by a prominent warning. Do not enable that override by default.
- Replace all remote HTTP examples in
SKILL.mdwith HTTPS examples and document that bearer credentials must never be sent over plaintext transport. - Preserve normal TLS certificate and hostname verification. Do not address this issue by disabling certificate validation.
- Consider validating the configured URL at startup, allowing only supported
httporhttpsschemes and rejecting embedded credentials, malformed URLs, and unexpected schemes. - Rotate any token that may previously have been transmitted to a remote service over plaintext HTTP.
- Require
