Menu

SSRF protection for webhooks: call user URLs safely
📰

SSRF protection for webhooks: call user URLs safely

DEV Community: backend·Sascha Mirow-Stanitzok·5 days ago
#TiF7TYXP
#devtobackend#devto#dev#const#ssrf
Reading 0:00
15s threshold

SSRF protection only becomes a topic once your application reaches out to the network on behalf of users. With webhooks, that is the normal case: an organizer enters a URL in your ticket shop, and your system sends a POST request there every time a ticket is sold. But what if the address does not point to the internet at all, and instead targets the metadata of your own infrastructure, an admin interface in a private network, or a service that should only be reachable internally?

I care about this topic because in many webhook implementations it ends up as a footnote. My own article on webhook retries with SQS gave SSRF just one short paragraph. Today it gets the space it deserves. You will learn how the attack works, why a simple check at registration is not enough, and how to build SSRF protection in four layers with Lambda, Node.js and AWS CDK that also survives DNS tricks.

In short

When users register their own webhook URLs, someone can trick your system into calling internal addresses.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.