SecLab
SSRF & calling external APIschallengeDifficulty 4/535 min

Challenge: a safe webhook fetcher

Objective: After this lesson you can design an "import from URL" feature an attacker cannot use to borrow your network position.

V13CWE-918API10:2023API7:2023
Step 1 of 5 · read3 min

The goal

The previous three lessons gave three layers: an application-layer allowlist, network-layer egress, and treating responses as untrusted input. This lesson combines them in the hardest case: a feature where a hostname allowlist is unavailable.

The situation. Product wants a feature: a user pastes the URL of a CSV file and the system imports from it. The URL can be anywhere — Google Drive, Dropbox, a customer's S3 bucket, a customer's internal server exposed to the Internet.

Which means ssrf-allowlist's hostname allowlist does not apply: you cannot know the hostnames in advance. This is not an unreasonable requirement — it is the ordinary requirement of every "import from URL" feature, and it is why this is a challenge.

What to produce.

  1. Design the fetch flow. How do you keep the feature without lending an attacker your network position?
  2. Name three places a naive implementation breaks, and which layer each needs.
  3. State what you cannot stop and why you accept it.

Question 3 is what counts. A security design that does not state its limits is one its users will over-trust.

View path

Comments

Join the discussion
Sign up to comment

Commenting needs an account with at least one completed lesson. That condition is what keeps this thread worth reading: every point belongs to someone who can be asked back, and reputation accrues over time.

Sign upSign in

You can still read every comment below without an account. Signing in brings you back to this exact spot, not to the top of the page.

Loading comments…