← Research

APIsec Labs · Excerpt · Original article: 8 min read

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

Agenta has a real egress gateway with private-range blocking, IP pinning, and redirects off.

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, HEAD 9c9f97b7, python:3.13 self-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.

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

DateEvent
Oct 6, 2026Three findings reported to the Agenta security team
Nov 6, 2026Fix released in v0.122.5; CVE-2026-123786 published alongside the vendor's GitHub Security Advisories
Nov 11, 2026APIsec 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_GRANT credential to tenant-registered destinations and scope it to the trusted env.services_url origin 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_WORKFLOWS as 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=False so a 302 can'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.

References

For every application you run

Find what's deployed and prove which exploits are real.

Go to apisec.ai