The paste trap: Our prettiest screen was feeding victims to our own security
The first real user of Sabu’s public admission wizard was me, and the system locked me out with an error message we engineered to be unhelpful. That sentence is the whole insight. Everything worked exactly as designed, and the design lied to me.
The setup. Families applying to a school get an 8-digit application code,
paired with their phone number — no accounts, no passwords, because a parent
at a cyber-café in Serrekunda is not going to remember a password. The
confirmation screen shows the code big and grouped for readability: 4314 6539.
Textbook UX. The resume screen accepts the code back with maxLength={8}.
Textbook input hygiene. And when code + phone don’t match, the API answers
with one uniform sentence — “Application code or phone number is incorrect” —
because a split error (“code OK, phone wrong”) teaches an attacker to
enumerate codes first and guess phones second. Textbook security.
Now compose them. I copied my own code off the confirmation screen. The
clipboard held 4314 6539 — nine characters, because we put the space
there. The input silently truncated the paste to seven: 4314 653. The
server stripped the space and saw seven digits. The uniform error fired. And
here is the vicious part: that error is engineered so the person reading it
cannot tell which factor failed. I had the right code and the right phone,
and the system was structurally incapable of telling me so.
It gets worse, because failed attempts are what our rate limiter counts. Ten mangled pastes — which is just one confused parent retrying — locks that code for fifteen minutes. The support cost is not hypothetical: the entire pitch of the code system is fewer front-desk visits, and this loop manufactures front-desk visits out of families doing everything right. Every one of those visits is a school clerk re-verifying identity by hand — the exact manual labor the product bills itself as eliminating.
The naive version, which passes every unit test you’d plausibly write (display renders? check; input caps at 8? check; wrong pair rejected? check):
<p className="code-display">{`${code.slice(0, 4)} ${code.slice(4)}`}</p>
<Input name="application_code" inputMode="numeric" maxLength={8} required />
The fix is embarrassingly small, which is the point — the bug was never in any one line, it was between the lines:
<Input name="application_code" inputMode="numeric" maxLength={12} required />
The server was already stripping every non-digit; the input just had to let the whole paste through. The rule we wrote down afterwards: any input must accept the formats your own product prints. If you display it grouped, you accept it grouped. Your clipboard is a data pipeline, and we had built a pipeline where stage one’s output failed stage two’s validation.
The deeper scar: uniform errors are a security trade, not a free win. You are deliberately spending diagnosability to buy enumeration resistance. That trade is only sound if every legitimate path into the error is closed — because once a real user is inside it, you have built a room with no signage, on purpose, and they are in it.
DESIGNER BLUEPRINT
A horizontal flow diagram in five nodes: [1c screen showing “4314 6539”] → [clipboard: “4314 6539” (9 chars, annotate the space in red)] → [1b input, maxLength=8, showing “4314 653” with the dropped digit falling off the edge] → [server: strips space, sees 7 digits] → [uniform error screen]. Then a feedback arrow looping from the error back to the input labeled “retry ×10” that terminates in a padlock node labeled “rate limited, 15 min”. The annotation under the whole flow: every node is behaving correctly. Color the three “correct decisions” (grouping, cap, uniform error) in calm blue and let the emergent path through them be the only red line on the diagram.