The Exploding SKU Regex
Medium About 30 min Katabench Pro
Rewrite the backtracking validation patterns of a catalog import so one poisoned supplier file cannot pin a CPU core.
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
- Resource exhaustion
- Bound sizes, expansions and regex backtracking so one request cannot exhaust the server.
Related katas
- Snippet Expansion Bomb (Billion Laughs) Medium Pro Meter nested template snippets as they expand, so a few self-multiplying snippets cannot exhaust memory or CPU before the size check runs.
- Clamp the Page Size Easy Pro Bound a user-requested page size so a huge value cannot exhaust the server.
- Block Private Hosts (SSRF) Medium Free Reject internal hosts so a user-supplied URL cannot make the server call itself or its neighbors.
- Comment Renderer (HTML Injection) Easy Free Fix a stored-XSS hole in a comment renderer without breaking its output.