When a Webhook Becomes a Way In
How a flexible “transform your webhook data” feature turned into a path from the public internet to cloud credentials, and what it took to close it.
- During a security review of a multi-tenant SaaS platform, I found that its custom webhook feature let users attach their own data-transformation rules.
- Those rules ran on the platform’s servers, could make network calls, and the webhook URL needed no authentication.
- Chained together, that let anyone on the internet reach internal systems and pull out cloud and database credentials. The fix was several small layers of defense, not one big patch.
The feature: a helpful little transformer
Many SaaS products let you connect outside tools through webhooks: the platform gives you a unique URL, and any time something happens in another app, that app sends data to the URL.
This platform went one step further. Because every tool formats its data differently, it let you write a small transformation rule that reshapes incoming data before it is stored. It is a genuinely useful feature, and exactly the kind of flexibility customers ask for.
Three small gaps
None of these looked alarming on its own. Each is the kind of decision a busy team makes for good reasons:
That third point is the important one. A “transformation rule” that can make network requests isn’t really a config setting anymore. It is code that the customer runs on your servers. And code running inside your network can talk to things the public internet never should.
The attack, step by step
This class of bug is called server-side request forgery (SSRF): tricking a server into making requests on an attacker’s behalf. Here is how the pieces fit together:
- Set up the trap. The attacker creates a webhook with a transformation rule that, instead of reshaping data, makes requests to internal addresses.
- Trigger it. They send anything to the webhook URL. No login is needed, so this works from anywhere.
- Reach inside. The rule runs on the platform’s own server and calls internal systems the outside world can’t normally see.
- Read the answers. Whatever those systems return is saved into the event, where the attacker simply reads it back.
What was within reach
In a test environment, and with all sensitive values redacted from our evidence, I confirmed the chain could reach:
- Other people’s login tokens sent to the same webhook, because the rule could read incoming request headers.
- Stored secrets attached to the webhook, readable in plain text.
- A map of the internal network: internal addresses and hundreds of internal services, from an internal proxy’s admin page.
- Cloud and database credentials, through an internal data-connector service that would reveal configuration values when asked to “validate” a config.
In plain terms: one unauthenticated web request could become a foothold inside the infrastructure. That is why it was rated critical.
How it was fixed: layers, not a single patch
The tempting fix is to block one internal address and move on. But SSRF has many bypasses (redirects, alternate address formats, new internal services), so the durable fix is several independent layers. Each one breaks part of the chain, and together they close it:
Lessons for anyone building integrations
- “Customizable” often means “code”. If users can supply logic that runs on your servers, threat-model it like untrusted code, because that’s what it is.
- Give features the least they need. A data transformer needs the data. It doesn’t need login headers, secrets, or the network.
- Control outbound traffic, not just inbound. Most teams firewall what comes in. SSRF is about what goes out from your own servers.
- Don’t trust the internal network. “It’s only reachable from inside” stops being a defense the moment something inside can be tricked.
- Fix in layers. Chained bugs are broken most reliably by several small, independent controls rather than one clever patch.
This finding came from an authorized security review and was reported and fixed before publication. Product names, internal systems and technical specifics have been generalized, and no real secrets are shown.