szn

Bug 260 — Denial of Service (CPU Exhaustion) via uncapped CSI b (REP) sequence

260. Denial of Service (CPU Exhaustion) via uncapped CSI b (REP) sequence

File: src/input.zig:583–586, src/screen.zig:768–775 Severity: HIGH Status: ✅ FIXED — clamped count to 4096 in repeatLastChar. Unit test added verifying max-u32 repeat doesn’t overflow grid bounds.

When the parser receives a Repeat Preceding Character sequence (CSI <n> b), count is stored as an arbitrary u32 (up to 4,294,967,295). repeatLastChar executes an uncapped loop writing character lc to the grid $n$ times.

Impact: Any process running in a pane can send \x1b[4294967295b to hang the szn server process in an infinite execution loop, freezing all connected clients.