Home▸Cybersecurity▸Path Traversal Defense Lab

Path Traversal Defense Lab: 2D Floor Stack

Interactive 2D path-traversal simulator: send a crafted '../' request against a file server drawn as a stack of directory floors, watch a naive path-concatenation bug let the request escape the sandbox, then flip on canonicalization + prefix-check and watch the same request get blocked before it crosses the root floor.

Cybersecurity2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-secure-coding ↗ Open standalone

This simulator turns a classic secure-coding bug — path (directory) traversal — into a 2D stack of directory floors. Each horizontal band is one directory level; the green band is the application's sandbox root. Send a request path containing ../ segments and a marker climbs or descends the stack floor by floor exactly the way the server's path-resolution logic would. In "naive concatenation" mode the marker is free to wander below the root into the red danger zone and the request still comes back 200 OK — a real information-disclosure bug. Flip to "canonicalize + prefix-check" and the identical request is stopped the instant it would cross the root boundary, with a 403 response. A third preset shows a URL-encoded traversal attempt (%2F for /) decoded before the walk runs, same as a real HTTP server would do. Live readouts track the resolved depth, how many .. segments were used, and a running count of breaches vs. blocked attempts.

⚙ Under the hood

A 2D floor-stack simulator of a path-traversal attack: send a crafted '../' or URL-encoded request against a simulated file server and watch a naive path-concatenation bug let it escape the sandbox, then flip on canonicalization plus a prefix-check and watch the identical request get blocked.

cybersecuritysecure-codingpath-traversalinput-validationweb-security2d-canvas

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)