Server-side request forgery
An AI agent built a Python endpoint that fetches a URL the user provides (for a 'link preview' feature) and returns the page title. It works for normal links. What request would let an attacker abuse this, and what should you add on review?
Implement
screen_preview_urls(urls: list[str], allowed_hosts: list[str]) → list[str]Examples
in
[["https://example.com/blog/post"],["example.com"]]out["allow"]in
[["http://example.com/","https://169.254.169.254/latest/meta-data/iam/"],["example.com"]]out["block:scheme","block:private_ip"]in
[["https://example.com@169.254.169.254/latest/meta-data/","https://cdn.example.com/a.png"],["example.com"]]out["block:private_ip","allow"]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 14 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.