The llm.agent module of flytohub/flyto-core accepts a caller-supplied base_url and, when the model is configured inline rather than through an ai.model sub-node, uses it verbatim as the target of an outbound HTTP POST. No SSRF validation runs on that path and no port restriction applies, so any workflow executor or MCP client can point the runner at an internal address and read the answer back. The issue is tracked as GHSA-pp5w-w9c3-qfv2 and was fixed in 2.29.0.
01Background: an agent module that talks to any OpenAI-compatible endpoint
flyto-core is a Python automation engine that exposes atomic modules to workflows and to MCP clients. llm.agent wraps a chat model, sends the caller's task, and returns the model's answer in data.result. The module is meant to work against local gateways, proxies and self-hosted inference servers, so it lets the caller name the endpoint through a base_url parameter.
That flexibility is also why the parameter needs a guard: whoever supplies the URL picks the destination, and the request leaves from the runner's own network. llm.chat and ai.model both run a URL check before building a client. llm.agent does not, which is a divergence, not a design decision.
02Root cause: the only guard is an anti-key-exfiltration assert
Resolution happens in _resolve_chat_model() in src/core/modules/atomic/llm/agent.py, roughly lines 879 to 923. With no ai.model sub-node connected, the inline provider, model, api_key and base_url values are used directly. The single control applied is:
assert_env_credential_endpoint_allowed(caller_base_url, key_from_env) # only guard on this path
That function is not an SSRF control. In src/core/utils.py (around lines 1075 to 1076) it returns immediately when the key did not come from the environment, and its docstring gives the reason: "A caller-supplied key going anywhere is fine (it is the caller's own secret, not the operator's)." The assert was added for a different advisory, GHSA-qq9q, which covered exfiltration of the environment-derived LLM key to an attacker endpoint. Its scope is the operator's secret, not the destination.
So when the caller passes their own api_key, the normal case for a workflow that carries credentials, key_from_env is False and base_url flows into the model builder untouched.
The destination is assembled in src/core/modules/atomic/llm/_chat_models.py. The constructor keeps the caller's string as-is and concatenates the path onto it:
# ~L135
self._base_url = (base_url or "https://api.openai.com/v1").rstrip("/")
# ~L154
url = f"{self._base_url}/chat/completions"
_http_post() (around lines 97 to 115) then issues a raw httpx.AsyncClient().post(url, ...), with an aiohttp fallback, and installs no custom resolver or transport. No allowlist, no DNS check, no private-address rejection and no port restriction sits between the parameter and the socket. Host, port and any path prefix all come from the same string. The destination can be an internal IP, a loopback address, a cloud metadata endpoint or an arbitrary service port such as 22, 5432 or 6379, which also makes the module usable for internal host and port discovery.
The siblings do the opposite. llm.chat (src/core/modules/atomic/llm/chat.py, around lines 155 to 164) carries the comment # SECURITY: Validate custom base URL for SSRF followed by validate_url_with_env_config(base_url). ai.model (src/core/modules/atomic/ai/model.py, around lines 140 to 149) applies the same guard and notes that the parameter "was previously unchecked here". validate_url_ssrf() blocks cloud metadata endpoints, enforces a port allowlist of {80, 443, 8080, 8443}, resolves DNS and rejects private addresses on every resolved result, failing closed. None of it applied to the inline llm.agent path.
03Proof of concept: differential test through the real MCP dispatch
The report demonstrates the issue end to end through core.mcp_handler.execute_module, with a fake OpenAI-compatible server listening on an RFC1918 address at port 54331. The run sets FLYTO_GRANTED_PERMISSIONS=shell.execute, the permission llm.agent itself declares, so a deployment that uses the module has already granted it.
execute_module('llm.agent', {
"task": "Say hello",
"provider": "openai",
"model": "gpt-4o",
"api_key": "sk-caller-own-key",
"base_url": "http://<internal-ip>:54331/v1"
})
The internal endpoint receives a POST carrying Authorization: Bearer sk-caller-own-key and an attacker-controlled body. The fake server's response comes back intact in data.result.
The control sends the same base_url through llm.chat. That call is rejected before any request is made, with the message Port 54331 not allowed. Allowed ports: [80, 443, 8080, 8443] and error_code: SSRF_BLOCKED. The differential isolates the missing guard to the llm.agent inline path. A reproduction script, poc_llm_baseurl_ssrf.py, was offered with the report.
04Impact: POST to any internal service, with partial or full readback
The primitive is an HTTP POST from the runner's network position to an arbitrary host and port. Targets named in the report include the cloud metadata service at 169.254.169.254, the Kubernetes API, internal proxies and admin panels. The method is POST rather than GET, so the attacker-controlled body (messages, model, temperature) can also act as a payload against services that parse their request body.
Responses return through three channels, depending on the target:
| Target behaviour | What the caller receives |
|---|---|
| HTTP status >= 500 | First 200 bytes of the body, inside the error message |
JSON without a choices key | Up to 300 bytes, via json.dumps(result)[:300] |
| OpenAI-shaped answer | Full content, as the agent's final answer in data.result |
The full-response case drives the score. An internal service that answers in OpenAI-compatible format turns the SSRF into a complete read of its reply. The report rates the issue 7.7 (High) on the vector AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N: confidentiality high because of that readback path, scope changed because the request leaves the application's own security context.
05Affected versions
| Package | Affected | Patched |
|---|---|---|
flyto-core (pip) | <= 2.28.1 | 2.29.0 |
Every release up to and including 2.28.1 resolves the inline model configuration without a URL check. 2.29.0 closes it. The advisory was published on 2026-08-23 as GHSA-pp5w-w9c3-qfv2 and carries no CVE ID. GHSA-f9q4-fp8j-r5h7 is an independent report of the same parameter; both reports are credited and both are fixed by the same change.
Disclosure timeline
- 2026-08-18Report opened with the differential MCP dispatch test and the
llm.chatcontrol case. - 2026-08-23Advisory
GHSA-pp5w-w9c3-qfv2published as High (7.7). - 2.29.0Fix released: the inline path calls
validate_url_with_env_configwithSSRF_BLOCKED, matching the sibling modules.
06Remediation: validate before building the client
The suggested fix is a parity change. Run validate_url_with_env_config(base_url) in the inline path of _resolve_chat_model() before create_chat_model, exactly as llm.chat and ai.model do, and raise the same error_code='SSRF_BLOCKED'.
The maintainer applied precisely that in 2.29.0. _resolve_chat_model now validates the caller-supplied base_url before constructing the model, so the port allowlist the control test demonstrated applies on this path too. The backward-compatible sub-node config dictionary reaches the same builder and gets the same check.
One more change matters for future audits: assert_env_credential_endpoint_allowed was removed from the outbound coverage gate's list of accepted guards, the list entry that had marked llm.agent as already guarded. Regression coverage landed in tests/core/test_reported_advisories_2026_08_19.py as test_llm_agent_inline_base_url_is_ssrf_guarded, test_llm_agent_sub_node_config_base_url_is_ssrf_guarded and test_llm_agent_reports_ssrf_blocked.
Operators who cannot upgrade immediately should treat llm.agent as a privileged primitive: restrict who may dispatch it, and block egress from the runner to metadata and cluster-internal ranges.