Design a Phishing Link Detector

Medium45 min
1 / 30
System design answer
Medium45 min30 sections
understanding•9 min read

Problem Statement: An Inline Security Pipeline, Not a Spam Filter

Frames phishing link detection as a latency-bound, verdict-critical security pipeline with four architectural planes.

Problem statement

Design a phishing link detector that intercepts inbound messages (email and enterprise chat), extracts every URL, evaluates each link against reputation, heuristics, and optionally a sandbox, then enforces a verdict: deliver cleanly, append a warning, quarantine the message, or rewrite the link so every later click is re-checked through a protection proxy.

The deceptive-link problem is distinct from bulk spam. A targeted credential-harvesting campaign may send only a few hundred messages, perfectly formatted, with no spam signatures at all. The industry consistently reports that the majority of intrusions begin with a deceptive message, and public threat reports from the Anti-Phishing Working Group record hundreds of thousands of unique phishing attacks every quarter. The detector therefore cannot rely on volume signals alone; it must reason about each URL on its own merits.

Why the problem is hard

  1. Latency is contractual. The mail transfer agent holds the message while we scan. Add 500 ms and delivery queues back up across tens of millions of messages.
  2. The weapon detonates late. A link that is clean at delivery time can be re-pointed to a credential-harvesting page hours later. Detection at delivery time is necessary but not sufficient; we need time-of-click protection and retroactive rescanning.
  3. False positives are business incidents. Blocking a password-reset link, an invoice, or a calendar invite from a legitimate domain generates help-desk storms and trains users to bypass security.
  4. Adversaries adapt weekly. Lookalike domains, homoglyph labels, compromised legitimate sites, and redirect chains all move the detection target continuously.

The four architectural planes

  1. Detection plane — extraction, canonicalization, reputation lookup, heuristics, ML scoring, sandbox detonation.
  2. Data plane — domain/URL verdict stores, threat-intel ingestion, feature pipelines, audit log.
  3. Enforcement plane — MTA/chat integration, link rewriting proxy, user warning pages, quarantine and release workflows.
  4. Feedback plane — user reports, analyst review, retroscan on verdict change, model retraining, campaign clustering.

A strong answer keeps these planes separate: the enforcement plane must degrade without weakening detection, and the feedback plane must improve models without silently changing the inline verdict path.

Key Highlights

  • •Phishing detection is per-URL verdict logic, not bulk spam scoring.
  • •Links detonate late: delivery-time verdicts must be paired with time-of-click re-checks.
  • •False positives are business incidents, measured and budgeted like SLOs.
  • •Four planes: detection, data, enforcement, feedback.
  • •The scan path is synchronous and latency-bound; deep analysis is asynchronous and queued.
Lead With Delivery-Time vs Click-Time
State in the first two minutes that a delivery-time verdict is not enough because links can be re-pointed after delivery. This instantly separates a senior answer from a generic spam-filter answer.
Do Not Design a Batch Scanner
A pipeline that scans messages after delivery, without an inline budget and a fail-open policy, does not answer the question. Mail flow latency is the core constraint.

Section Rescue Kit

Buzzwords to use:

Time-of-Click ProtectionVerdict

Safe statements:

  • "I will separate delivery-time scanning from click-time re-checking before drawing any boxes."
  • "Let me define the verdict contract first, because enforcement, logging, and feedback all consume it."
Design a Phishing Link Detector - System Design | WinJob | WinJob