Section 10: The Domain You Can't Afford to Lose - Security & Abuse Prevention
Executive Summary: A URL shortener hides where a link goes, and anyone who wants to send people somewhere they shouldn't go finds that very useful. This section builds the threat model (phishing and malware delivery, spam link farms, code enumeration, and the one that can end the product: our own domain getting blocklisted). Then it layers the controls: scheme and length validation, a threat-list check that fits inside the 200 ms create budget, asynchronous re-scanning, rate limits, and a link lifecycle that can disable a bad link everywhere within 60 seconds. We walk the phishing page impersonating Maya's store through every layer and defend why the codes stay short, even though anyone can guess them.
The interviewer leans back. "Your system survives viral links and region outages. Now: I'm a scammer. Why is your shortener my favorite tool?"
You: "Because it launders destinations. A link that says tiny.example/aZ3kP9q tells the reader nothing about where it goes, and spam filters see our domain instead of yours. So before any controls, let me name what we're actually defending."
The Threat Model
| Threat | What the attacker gains | What it costs us |
|---|---|---|
| Phishing / malware delivery | A trusted-looking wrapper around a malicious page | Harmed users, and our domain's reputation |
| Spam link farms | Millions of throwaway links to dodge per-URL filters | Storage, write capacity, and reputation |
| Code enumeration | Walking the code space to discover links | Private-looking links get exposed |
| Domain blocklisting | Nothing directly. It is the result of the first three | Every customer's links break at once |
You: "The last row is the existential one. Email providers and browsers keep reputation lists for domains. If tiny.example becomes known as a phishing launderer, mail gets filtered and browsers show warnings for all our links, including Maya's legitimate newsletter going to 2 M subscribers. Abuse prevention here isn't a side feature. It protects the availability of the whole product."
Critical Insight: For a shortener, reputation is an availability dependency. The 99.99 % redirect target from Section 2 means nothing if the receiving mail server drops the message before anyone clicks.
Quick check before moving on:
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson