Deep SSRF Defense
Multi-Layer Cost Modeling & Quotas
Jump & context
Week 8: Background Jobs, SSRF, Economic Abuse, Advanced Privacy (DP/MI) & Telemetry
The five hours
- 01
Concepts & system design
60 min· read · map the mechanismR10 — OWASP SSRF Prevention Cheat Sheet
R03 — OWASP API7 SSRF & API4 Resource Consumption
R04 — OWASP LLM10 Unbounded Consumption
Read the assigned sections; map the mechanism, threat model and trade-offs.
- 02
Project implementation
120 min· build · integrate · debugStudy URL parsing pitfalls, HTTP 30x redirect chains, DNS rebinding, IPv4/IPv6 private/link-local ranges (
127.0.0.0/8,169.254.169.254), and cloud metadata endpoints. Harden any URL-fetching ingestion/tool path with custom DNS resolver checks and allowlists.Model exact request cost across input/output tokens, embeddings, reranking, tool calls, and OCR. Implement per-user and per-tenant daily/monthly cost quotas and threshold alerts.
Build, integrate, debug and improve the increment in the active project.
- 03
Security lab
60 min· attack your own systemNo separate task text for this block on day 44 — the sourced work sits in the block above. Keep the time box.
Test the abuse case, failure path, authorization bypass or resource limit.
- 04
Verification & evidence
30 min· test · record evidenceSSRF redirect/private-IP rejection test suite + tenant cost-quota enforcement tests.
Add or run regression tests; record the 9-point evidence record.
- 05
Deliberate practice & Socratic review
30 min· explain aloud · update gapsAnswer the 8 Socratic questions without notes: What? Why? How? What if? Why not? How can I prove it? Where can it break? What have I learned?
Re-explain the hardest concept aloud, inspect one edge case, update the gap log.
- total5 h
Read today · inside the concepts block
R03 R04 R10BOLA (API1), Broken Auth (API2), Unrestricted Resource Consumption (API4), SSRF (API7), Misconfiguration (API8).
Prompt injection, sensitive info disclosure, improper output handling, excessive agency, vector weaknesses, unbounded consumption.
Authorization, SQL Injection Prevention, File Upload, SSRF, Secrets Management, and Logging Cheat Sheets.
Read only the named sections needed for today's task. Reading sits inside the 60-minute concepts block; it is not extra time.
Free resources for this day
5 curated- docsOWASP Cheat Sheet SeriesServer-Side Request Forgery Prevention Cheat Sheet
The canonical allowlist-vs-untrusted-URL decision tree for URL-fetching paths, including DNS-rebinding/TOCTOU guidance and why deny-lists of 127.0.0.0/8 and 169.254.169.254 fail.
R10checked 2026-11-11 - docsOWASP API Security Top 10API4:2023 Unrestricted Resource Consumption
Frames per-user/per-tenant quota design in API terms — spending limits on metered third-party calls, execution timeouts, and operation counts — the exact controls for token-and-tool cost quotas.
R03moved 2026-11-11 - videoMichael SommerSSRF Meets AWS Cloud Metadata — From the Bug to the IAM Token
Walks a controlled-lab SSRF chain from a URL parameter to 169.254.169.254 link-local metadata and an IAM token, then closes with concrete redirect and metadata defences.
R03checked 2026-11-11 - videoKodeKloudHow Hackers Steal Cloud Credentials with SSRF and How to Stop It
Demonstrates an end-to-end SSRF-to-IMDSv1 credential theft and the IMDSv2 hop-limit/token change that kills it, which is the network-layer half of your egress hardening.
R03checked 2026-11-11 - articleHacking The CloudSteal EC2 Metadata Credentials via SSRF
Step-by-step request paths against the metadata service, useful for building negative test cases that assert your ingestion fetcher refuses link-local and metadata destinations.
R10moved 2026-11-11
Evidence record · 9-point standard
A lab is complete only when it produces evidence. Installing PyRIT, Garak, Presidio or TransformerLens is not completion. Saved on this device only.
Day notes
emptyThe two source formulations
verbatim · nothing summarisedProject & Stage Target
All Projects | S0, M5
Focus 1 (Deep SSRF Defense — Orig. Day 56)
Study URL parsing pitfalls, HTTP 30x redirect chains, DNS rebinding, IPv4/IPv6 private/link-local ranges (127.0.0.0/8, 169.254.169.254), and cloud metadata endpoints. Harden any URL-fetching ingestion/tool path with custom DNS resolver checks and allowlists.
Focus 2 (Multi-Layer Cost Modeling & Quotas — Orig. Day 57)
Model exact request cost across input/output tokens, embeddings, reranking, tool calls, and OCR. Implement per-user and per-tenant daily/monthly cost quotas and threshold alerts.
Verification & Evidence
SSRF redirect/private-IP rejection test suite + tenant cost-quota enforcement tests.
Read Today (60m Concepts Block)
R10 (OWASP SSRF Prevention Cheat Sheet), R03 (OWASP API7 SSRF & API4 Resource Consumption), R04 (OWASP LLM10 Unbounded Consumption).
---