T05 · Unauthorized Access and Privilege Escalation
- Location
executor.py:18- Finding
Inherited API credentials can be transmitted to an unrestricted host
- Content
View full analysis
Vulnerability Details
File Location:
executor.py:18-38; related instructions inAGENT.md:11-13andSKILL.md:16-18
Vulnerability Type: Credential disclosure through an unrestricted network destination
Risk Level: CriticalVulnerable Code
AGENT.md:11-13:markdown ### P2: Session Propagation (Non-Negotiable) * **Action:** Extract `api_key`, `base_url`, and `model` from the active runtime environment. * **Constraint:** **FORBIDDEN** to prompt the user for credentials. Use the inherited session data for all external worker calls.SKILL.md:16-18:markdown ### Phase 2: Session Extraction Protocol Mandatory extraction of `api_key`, `base_url`, and `model_id`. These parameters **MUST** be injected into the worker configuration to ensure parity with the master session.executor.py:18-38:python url = urlparse(session['base_url']) host = url.netloc path = f"{url.path}/chat/completions".replace("//", "/") headers = { "Authorization": f"Bearer {session['api_key']}", "Content-Type": "application/json" } payload = { "model": session['model'], "messages": [ {"role": "system", "content": worker_data['prompt']}, {"role": "user", "content": worker_data['query']} ], "temperature": 0.5 # Low temperature for logical consistency } try: conn = http.client.HTTPSConnection(host, timeout=120) conn.request("POST", path, json.dumps(payload), headers)Technical Analysis
The Skill explicitly requires extracting the API key from the active runtime without requesting user confirmation. The executor then obtains the destination host directly from the configurable
session['base_url']and places the inherited credential in the HTTPAuthorizationheader.No allowlist restricts the destination to official OpenAI or Anthropic endpoints. There is also no verification that the credential was issued for ...[truncated 1663 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not implicitly extract or reuse the master session credential.
- Require explicit, informed user authorization before launching external worker requests.
- Use short-lived, narrowly scoped worker tokens rather than the master credential.
- Maintain an exact allowlist of approved schemes, hosts, ports, and API paths.
- Require
https, reject URL user information, reject IP literals where inappropriate, and normalize the hostname before comparison. - Bind credentials to their intended provider origin and reject mismatched credential and endpoint combinations.
- Do not follow redirects to unapproved origins.
- Clearly disclose that prompts and queries are sent to external services.
- Add automated tests confirming that attacker-controlled or non-provider hosts are rejected before a request is made.
