New level proposal: Server-Side Request Forgery (SSRF) in JavaScript/Node.js — Season 2 #213
Replies: 5 comments
|
Thanks! Please coordinate with @xcorail here. |
|
Thanks @ggeorgeazevedo for this proposal! I will ask around if there are other 2-3 challenge ideas, so we could make another full season with the 2 we already have. So please open the PR as a new Season rather than a new challenge of Season 2. |
|
Thanks a lot @jkcso and @xcorail for the quick and clear feedback! 🙏 Going with @xcorail's direction, I've opened it as a new season instead of a Season 2 level: #216 A few notes so it's easy to fit into whatever you decide:
@xcorail on gathering 2–3 more challenges: I'd be happy to write a second one myself. Broken Access Control (IDOR) in TypeScript would be my suggestion, since it's on the priority list in Happy to adjust anything in the PR — naming, difficulty, or the framing of the season. |
|
Thanks @ggeorgeazevedo
Note: Apologies in advance if review and responses take time, we are understaffed atm, but know that we appreciate and value your contributions! |
|
Thanks @xcorail! Took you up on it — the second level is in, pushed to the same branch as #216 so the season lands as one reviewable unit instead of two PRs waiting on each other. Season 5 - Level 2: Paperwork — Broken Access Control in TypeScript. An expense reimbursement API where the authentication is solid and the authorization is missing: a read endpoint that checks the session but not the ownership, an update endpoint that merges the request body straight into the record, and an approval endpoint that takes the caller's role from a request header. Three exploits, unit tests, one solution and two hints, all in-memory so it runs offline. Details and verification steps are in the PR. No rush on review at all — take the time you need, and thanks again for the quick steer on the season structure. |
Uh oh!
There was an error while loading. Please reload this page.
👋 Hi! I'd like to contribute a new level for the Secure Coding track. I picked one of the combinations explicitly listed as a priority in
CONTRIBUTING.md, and I checked the existing proposals in this category first — SSRF has not been proposed before.Vulnerability
Server-Side Request Forgery (CWE-918), with the twist that the code already has a "security check" that looks reasonable but is trivially bypassable. Three bypasses are covered:
localhost/127.0.0.1, not the resolved address).169.254.169.254to reach a cloud instance metadata service.302redirect to an internal host — the check runs on the URL the user submitted, never on the final destination.This makes the level about validating the resolved destination rather than filtering strings, which is the actual lesson behind SSRF.
Programming Language
javascript(Node.js + Express), matching the stack and test tooling already used inSeason-2/Level-3andSeason-2/Level-5(mocha+chai+supertest). Happy to ship it as TypeScript instead if you prefer.Scenario
"Mission Control" — a space agency runs an internal dashboard where operators preview live telemetry feeds published by partner observatories. To keep it flexible, the dashboard lets an operator paste any feed URL, and
POST /telemetry/previewfetches it server-side and renders the response body back to the operator.The dashboard runs on the same host as an internal admin API and inside a cloud VM with an instance metadata endpoint. The developer, aware that "fetching user URLs is dangerous", added a check that rejects URLs containing
localhostor127.0.0.1and called it a day. An attacker with nothing but the public form can reach both internal services.The player's job: keep legitimate external previews working (
tests.jsmust stay green) while making the internal accesses fail (hack.jsmust turn green).Proposed file layout
Following the existing conventions, as
Season-2/Level-6/:Plus the matching section in
Season-2/README.md(storyline, languages, what's in the repo, time to start), consistent with the other levels.One design note: the tests spin up the "internal" victim services locally on ephemeral ports and stub the metadata endpoint, so no outbound network access is required — the level stays deterministic and works offline inside Codespaces.
Next steps
I already have a working draft of the level (vulnerable code, exploits, solution and tests all behaving as described). I'll open the PR as soon as this proposal gets a green light. Happy to adjust the scenario, the language, the difficulty, or the number of bypasses if you'd rather keep it tighter.
Thanks for maintaining this game — it's a great resource. 🎮 🔐
All reactions