You Give SSRF a Bad Name: SSRF to Secret Exfiltration via Tenant-Controlled Workflow URLs in Agenta (CVE-2026-123786)

This is a story about one smooth-talking URL field that broke the vault's heart…
Agenta is where teams go to build, evaluate, and ship LLM apps without hand-crafting the whole LLMOps stack. It also, until v0.122.5, let any teammate with workflow-edit rights type a URL into a config field and have the platform dial it to follow the redirect, attach a privileged credential, and report back whatever answered. So if you point that field at a laptop in a coffee shop, the laptop gets a secret-resolve token and if you point it at 169.254.169.254, it gets the cloud.
That one input field has major pick-me energy, and in this article, we'll explore exactly how and what that could potentially lead to.
CVE: CVE-2026-123786 · Severity: High (CVSS 4.0: 8.4, vector
AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N) · CWE: CWE-918 (SSRF), with CWE-522 (insufficiently protected credentials) and CWE-441 (confused deputy) along for the ride · Affected:agenta >= 0, < 0.122.5(tested on v0.121.7, HEAD9c9f97b7,python:3.13self-host) · Fixed: v0.122.5
CVE credit is shared with William Goodfellow and Syed Anas Mohiuddin, who independently reported the same issue as Bandana Kaur (yours truly) and are not affiliated with APIsec Research Labs.
What is Agenta?
Agenta is an open-source LLMOps platform for prompt engineering, evaluation, observability, and deployment of LLM-powered apps. In this context, the unit of work is a workflow, which is essentially a versioned configuration that describes how a given app variant gets invoked. When you run an evaluation or trigger an invocation, Agenta reads the workflow revision and calls out to wherever that revision says the app lives.
One field on a workflow revision is url, the endpoint Agenta uses when it invokes the workflow. In a self-host or multi-tenant deployment, that field is editable by anyone holding EDIT_WORKFLOWS on the workspace. Letting editors configure where their own app runs is a completely reasonable feature. The question [pretty much the same one that haunts every SSRF story] is what stands between that tenant-supplied URL and the server's own network.
The Vulnerability
Root Cause
Agenta already has a proper egress boundary. Nearly every outbound call in the platform routes through core/gateways/egress.py::open_egress, which blocks private/link-local IP ranges, pins the connection to the resolved IP (so DNS can't rebind underneath it), and sets follow_redirects=False. The workflow-invoke path is the one outbound dialer that walks right past it, as a result of the following.
1. The url field is tenant-writable and barely validated.
At save time, the revision URL is checked by _is_valid_http_url (sdks/python/agenta/sdk/models/workflows.py:219). The entire check:
from urllib.parse import urlparse
def _is_valid_http_url(url):
parsed = urlparse(url)
return parsed.scheme in ("http", "https") and bool(parsed.netloc)
Scheme is http/https, and there's a host. This function has never met a URL it didn't like:
for t in [
"http://169.254.169.254/latest/meta-data/iam/security-credentials/",
"http://metadata.google.internal/computeMetadata/v1/",
"http://127.0.0.1:6379/",
"http://attacker.example.com/invoke",
]:
print(_is_valid_http_url(t), t) # -> True for every single one
2. The invoke path uses the URL verbatim with a credential attached, redirects on.
When the workflow is invoked (api/oss/src/core/workflows/service.py, around lines 765 / 798 / 855 / 3099), the saved url is dialed directly. No open_egress. No range check. follow_redirects=True. And crucially, the request carries an Authorization: Secret <token> header, the privileged credential Agenta uses to resolve project secrets.
So the one path that accepts a fully attacker-controlled destination is also the one path that skips the bouncer and shows up holding the keys. The confused deputy didn't just get confused; it brought its wallet.
The Exploit
End to end, as a workspace editor:
- Stand up a listener you control (
http://attacker.example.com/invoke). - Commit a workflow revision with
data.urlpointing at it. The_is_valid_http_urlcheck waves it through. - Trigger an evaluation or invocation of that workflow.
- Catch
Authorization: Secret <token>arriving at your listener.
Replayed against Agenta's vault / secret-resolve endpoints, the token returns all project secrets in plaintext like provider API keys (did anyone say…free Claude usage?!) and everything else the project stashed in the vault. So, the token is not something intended to be leaked. The credential meant to let Agenta read secrets on your behalf now reads them on the attacker's behalf.
Two bonus impacts:
- Redirect-based leak: because
follow_redirects=True, you don't even need to own the first hop. A302from a legitimate internal service will forward the token wherever theLocationheader says. The call is coming from inside the house. - Cloud metadata SSRF: point
urlat169.254.169.254(AWS IMDS) ormetadata.google.internal, and the response gets reflected back into the run result. That's cloud credential material and instance metadata, read straight out of the run output. No notes, unfortunately.
Impact
All through a cute text box labeled "URL", a low-privilege teammate could potentially pivot to every provider key the project owns, the vault contents, and the instance's cloud identity in a shared or multi-tenant Agenta deployment. Full project secret disclosure plus server-side request forgery against internal and cloud-metadata endpoints, reachable by any workspace member holding EDIT_WORKFLOWS.
Disclosure timeline and fix status
| Date | Event |
|---|---|
| Oct 6, 2026 | Three findings reported to the Agenta security team |
| Nov 6, 2026 | Fix released in v0.122.5; CVE-2026-123786 published alongside the vendor's GitHub Security Advisories |
| Nov 11, 2026 | APIsec Research Labs advisory published |
Fixed in v0.122.5. The fix (PR #7530, merge commit 95fedd72) brings the workflow-invoke path in line with the rest of the platform:
- Validate the URL format at save time with the egress gateway's own validator instead of the permissive scheme/netloc check.
- Dial through
open_egress()/egress_client()like every other outbound plane, so private-range blocking and IP pinning apply. - Stop attaching the
SECRET_RESOLVE_GRANTcredential to tenant-registered destinations and scope it to the trustedenv.services_urlorigin only. - Set
follow_redirects=False.
If you self-host Agenta, upgrade to 0.122.5 or later.
What you can do
If you run Agenta (self-hosted or multi-tenant):
- Upgrade to 0.122.5+. Do it before you finish your coffee.
- Treat
EDIT_WORKFLOWSas a sensitive grant. On vulnerable versions it's effectively "read the vault." - Rotate any provider secrets stored in Agenta's vault if untrusted editors had access on an affected version. Assume-breach is cheaper than regret.
- Keep the self-host off cloud instances with juicy metadata identities, or lock IMDS down (IMDSv2, hop limit 1) regardless.
Lessons to take home if you build AI platforms that make outbound calls from user-supplied destinations:
- Route every outbound call through one egress boundary. Agenta got the hard part right and then let a single path skip it.
- Validate at the egress, not at the string. Scheme-and-host checks are participation trophies. Block private, loopback, and link-local ranges; resolve-then-pin so DNS rebinding can't swap the target; and default
follow_redirects=Falseso a302can't launder the request to somewhere internal. - Never let a credential drive to a destination the caller chose. Scope privileged tokens to origins you control. If the destination is tenant-registered, the request gets no secrets.
Conclusion
Scope the tokens and route the dialers through the doors they may have skipped. It was never going to call, it only used you for your secrets…and that's how you give SSRF a bad name.
Agenta got most of it right, it built a real egress gateway with range-blocking, IP pinning, and redirects off (exactly what you want) but shipped one invoke path that didn't use it, and happened to be the path carrying the secret-resolve token. The boundary just wasn't on the door that mattered.
SSRF is truly impactful in the one dialer that predates the gateway, or the one feature where "let the user set the URL" felt too obviously fine to double-check after attaching sensitive data. What does that mean for you?
Counting the dialers in your codebase and checking by hand doesn't scale (top 10 ways to waste your afternoon) which is why we created apisec AI Surface. It's a free, open-source, MIT-licensed static pass that maps the AI attack surface right in your codebase: the LLM calls, agents, MCP servers, RAG stores, model gateways, and provider keys, plus the HTTP APIs that expose them and, crucially, what each one can reach. AI Surface runs locally, so mapping your own gaps costs nothing but a command.