Articles

What Is a CAPTCHA? How Bot-Detection Challenges Work

A CAPTCHA is a challenge designed to be easy for humans and hard for automated scripts. How image, text, and invisible CAPTCHAs actually distinguish the two.

Chisato Chisato · · 5 min read
A shield icon representing web security

A CAPTCHA (“Completely Automated Public Turing test to tell Computers and Humans Apart”) is a challenge inserted into a web form that’s designed to be trivial for a human to solve and difficult for an automated script to pass. Sites use them to slow down bots that would otherwise create fake accounts, post spam, scrape content in bulk, or hammer a login form with credential-stuffing attempts — automated abuse that ordinary rate limiting alone doesn’t fully stop, since a rate limit only caps how fast a bot works, not whether it’s a bot at all.

The core idea: asymmetric difficulty

A CAPTCHA works by picking a task where the gap between human and machine performance is (or historically was) large. Early text-based CAPTCHAs distorted letters with noise, warping, and overlapping strokes — trivial for a human eye trained on years of reading messy handwriting, but genuinely hard for the optical character recognition software of the time. Image-selection CAPTCHAs (“select all squares with a traffic light”) leaned on the same idea: humans are good at fuzzy visual classification in ways that were, for a long time, expensive to automate.

That gap has narrowed considerably as machine learning has gotten better at exactly these tasks, which is why CAPTCHA design has shifted away from pure perception challenges toward signals that are harder for a script to fake convincingly.

Common CAPTCHA types

  • Text-distortion CAPTCHAs — the classic warped-letters image. Increasingly rare today because modern OCR solves them reliably.
  • Image-selection CAPTCHAs — “click every image containing a bicycle.” Still common, though automated solving services (and increasingly, vision models) have eroded their effectiveness too.
  • Invisible / behavioral CAPTCHAs — instead of presenting a puzzle at all, these analyze signals like mouse movement, typing cadence, browser fingerprint consistency, and how the page was loaded, scoring the session as human or bot without interrupting the user. Most modern CAPTCHA services default to this mode and only fall back to a visible challenge when the score is ambiguous.
  • Proof-of-work CAPTCHAs — instead of testing “human-ness” directly, the browser is made to solve a small, deliberately expensive computation before the form submits. A single human submitting one form barely notices the delay; a bot trying to submit thousands of forms pays a real, multiplying computational cost.
  • Honeypot fields — not a CAPTCHA in the strict sense, but often deployed alongside one: a form field hidden via CSS that real users never see or fill in, but that naive bots fill in automatically. Any submission with that field populated is silently rejected. It’s the low-effort, invisible-to-users cousin of a real honeypot.

What CAPTCHAs are actually defending against

CAPTCHAs sit in the same defensive layer as other anti-abuse controls, and are usually deployed alongside them rather than instead of them:

  • Credential stuffing — bots trying leaked username/password pairs against a login form at scale. See what a credential-stuffing attack looks like and why rate limiting alone doesn’t stop it.
  • Account creation abuse — bots mass-registering fake accounts for spam, fraud, or inflating engagement metrics.
  • Content scraping — automated scripts pulling large volumes of content or pricing data.
  • Denial-of-service via forms — cheap, expensive-to-process form submissions (DDoS-adjacent abuse) aimed at exhausting server or email resources rather than bandwidth.

A CAPTCHA doesn’t stop a determined, well-resourced attacker — commercial CAPTCHA-solving services exist that route challenges to human workers or trained models for a small fee per solve. What it does is raise the marginal cost of each automated attempt, which is enough to deter the high-volume, low-effort bots that make up the bulk of automated abuse.

The accessibility and UX tradeoff

Every visible CAPTCHA is friction placed between a real user and the thing they’re trying to do, and that friction isn’t evenly distributed. Distorted-text challenges are genuinely difficult for users with visual impairments; audio alternatives help but add their own barrier. Image-grid challenges assume cultural and visual context that doesn’t translate perfectly across languages and regions. This is a large part of why the industry trend has moved toward invisible, score-based checks that only interrupt the small fraction of sessions that look suspicious, rather than challenging every visitor by default.

Where CAPTCHAs get placed

CAPTCHAs are cheapest to justify on the actions that cost the most to abuse: account signup, login after repeated failures, password reset requests, checkout on a form prone to card-testing fraud, and comment or review submission on public content. Slapping one on every form on a site is a common overcorrection — it adds friction to low-risk actions (like a contact form that gets a handful of legitimate submissions a day) while barely inconveniencing an attacker targeting a genuinely high-value endpoint, who has every incentive to pay a solving service the few cents it costs to get through. A threat-model-driven placement, reserving challenges for the endpoints actually being abused, gets more of the security benefit for a fraction of the user-facing cost.

CAPTCHA design goals in tension

GoalPulls toward
Stop botsHarder challenges, more friction
Good UXFewer, shorter, or invisible challenges
AccessibilityMultiple challenge modes, audio alternatives
PrivacyLess behavioral tracking and fingerprinting

No CAPTCHA implementation maximizes all four simultaneously — every deployment is a tradeoff, and where a site lands on it says as much about its threat model as it does about its user base.

The takeaway

A CAPTCHA raises the cost of automating a form submission by exploiting a gap — real or engineered — between human and machine performance on some task, from distorted text to behavioral scoring to a deliberate computational cost. It’s not a silver bullet against determined attackers, and every visible challenge trades off some accessibility and user experience for that protection, which is why most production deployments now default to invisible, risk-scored checks and reserve a visible puzzle for the sessions that actually look automated.

Chisato Chisato · · 4 min read

Trusted Types API: Stopping DOM XSS at the Sink

The Trusted Types API blocks DOM-based XSS by forcing risky DOM sinks like innerHTML to accept only vetted objects instead of raw strings.

#Security #Web Development #JavaScript
Chisato Chisato · · 4 min read

What Is a Man-in-the-Browser Attack?

A man-in-the-browser attack uses malware inside the browser itself to alter what a user sees and submits, bypassing HTTPS and session protections entirely.

#Security #Authentication #Web Development