Host Allowlist
Medium About 15 min Katabench Pro
Match a hostname against an allowed domain without the suffix-confusion bug.
The full brief is part of Katabench Pro
Pro opens this kata's brief, its starter code and its grader. To see how the track works first, try Block Private Hosts (SSRF), which is free.
How it is graded
Functional tests and adversarial payloads both have to pass before the solution is accepted.
What it practices
- URL and origin validation
- Validate redirect targets, hosts, CORS origins and link schemes without suffix tricks.
Related katas
- CORS Origin Reflection Medium Pro Decide the Access-Control-Allow-Origin value by exact allowlist, not a suffix match an attacker can satisfy.
- Open Redirect Validator Medium Pro Allow only same-site redirect targets, blocking the off-site tricks.
- Link Scheme Allowlist Easy Pro Render a user-supplied link only when its scheme is one you trust, instead of blocklisting the dangerous ones.
- Block Private Hosts (SSRF) Medium Free Reject internal hosts so a user-supplied URL cannot make the server call itself or its neighbors.