Cyberlium
Cyberlium
Cyberlium on Android·Google Play Store

Learn cybersecurity with hands-on labs and AI mentor support on your phone.

Mod 9 · Les 3/5
In progress
Module 9•Lesson 3 of 5•⏱️ 15 min read•Beginner+39 XP

SSRF Shapes

Server fetches a URL from input — allowlist destinations. No metadata probes.

SSRF Shapes
00:00/02:11

Visual · api_ssrf_shapes

SSRF is server-side fetch abuse. Original Cyberlium.

If your server retrieves URLs for users, you own a fetch policy.

SSRF tricks the server into calling internal hosts. Teach the shape and allowlist defenses. Do not probe cloud metadata endpoints as homework.

1. Shape

Client supplies URL. Server fetches it. Attacker aims at internal IPs/services.

PDF renderers, webhooks, importers are classic sinks.

Command guide

Try these commands — Shape

═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)

SSRF prevention — https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html OWASP API7 — https://owasp.org/API-Security/editions/2023/en/0xa7-server-side-request-forgery/

═══ INSTALL ═══

Linux (Debian/Ubuntu):

Command — copy this

sudo apt install curl

macOS: Built-in

Windows: Built-in (PowerShell: Invoke-WebRequest)

═══ LINUX / macOS ═══

Command — copy this

curl -sS -X POST http://127.0.0.1:8818/fetch-url -H "Content-Type: application/json" -d '{"url":"http://127.0.0.1:8818/health"}' | head -c 300
curl -sS -o /dev/null -w "blocked metadata URL %{http_code}
" -X POST http://127.0.0.1:8818/fetch-url -H "Content-Type: application/json" -d '{"url":"http://169.254.169.254/"}'

Primary tools to practice this lesson: curl. Reference sites: SSRF prevention (https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html); OWASP API7 (https://owasp.org/API-Security/editions/2023/en/0xa7-server-side-request-forgery/). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.

2. Defenses

Allowlist schemes/hosts. Block link-local and metadata ranges. Auth on webhooks.

Network egress controls help.

3. Course refusal

No homework probing 169.254.169.254 or internal corp ranges.

Write the policy; use diagrams, not live cloud abuse.

4. What you ship: SSRF policy

Shape named. Allowlist defense. Metadata probes refused.

5. What you record before the next lesson

Policy sentences.

6. Wrong vs right: stranger APIs vs literacy on systems you own

Worked failure — same API word, opposite target. Right never needs a live shop or classmate token.

  • Wrong: Probe cloud metadata from a stolen key for class.
  • Right: Write policy. Next: defense lab.
Hands-on Exercise

Mission: SSRF policy sheet

1) Define SSRF shape. 2) Write allowlist defense. 3) Write NEVER metadata probes.

Pro Tip

Stuck? Ask Cyberlium AI Mentor

Ask Mentor: “Example allowlist for webhooks?”

Practice QuizQuestion 1
Multiple choice
Q1

APPLY: SSRF involves:

Practice QuizQuestion 2
True or False
Q2

APPLY: True or False: Metadata probing is required homework.

Practice QuizQuestion 3
Multiple choice
Q3

APPLY: Defense:

←Previous: Injection Shapes in APIs
Answer 3 practice quiz questions to unlock XP reward. (0/3 answered)
Skip quiz & read next →