Yahoo Security Question Database eBook
Explains how backup answers for recovery questions
by Booth Lenita
Explains how backup answers for recovery questions were stored in plain text.
Formats
Free sample
Chapter 1: The Open Door--The command that changed the internet forever was deceptively simple.It was a Tuesday evening in late 2014, Pacific Time, when an attacker sitting at a rented server in Eastern Europe typed a string of characters into a terminal window. The command was not elegant. It did not rely on zero-day exploits or nation-state-grade encryption-breaking mathematics. It was a variation of a SQL injection payload that had been publicly documented since 1998—sixteen years before this moment. The attacker was not a genius.
They were persistent.The database server on the other end of that connection, somewhere in Yahoo’s sprawling infrastructure, received the command. Instead of rejecting it as malformed input, the server paused, then began to respond. Slowly at first, then with accelerating speed, rows of data began to stream back across the Atlantic. User IDs. Password hashes.
Dates of birth. Backup email addresses. And nestled among these columns, in fields labeled security_question_1, security_question_2, security_answer_1, and security_answer_2, were the answers that Yahoo users had provided over the years to questions like “What is your mother’s maiden name?” and “What was your first pet’s name?” and “In what city were you born?”Some of these answers were stored as plain text—readable immediately, as if written on a sticky note attached to a server. Others had been passed through base64 encoding or XORed with a static key that was stored in the same database. From the perspective of the attacker, the distinction was irrelevant.
Both were reversible in milliseconds. Both would become ammunition.The attacker did not know immediately how many records they had accessed. The dump continued for hours, then days. By the time it finished, the attacker possessed 500 million rows of user data—one of the largest data breaches in history, though they did not know that yet. What they did know, with absolute certainty, was that Yahoo had left its front door unlocked.
And they had just walked through.The Twenty-Year-Old Vulnerability That Refused to Die SQL injection—the technique the attacker used—is not a sophisticated attack. It exploits a simple failure: when a web application accepts user input and inserts that input directly into a database query without checking what the input contains, an attacker can “inject” additional SQL commands. The database, unable to distinguish between legitimate commands and attacker-supplied ones, executes both.The first public documentation of SQL injection appeared in 1998, in a post to the Phrack magazine by a hacker named “rfp” (Rain Forest Puppy). The post was titled “How I Hacked Packetstorm” and described, in technical detail, how the author had used SQL injection to gain access to a popular security website’s database. The security community took notice.
By 2000, SQL injection had appeared in the OWASP Top 10 list of web application vulnerabilities. By 2003, the FTC had cited SQL injection as a “well-known and foreseeable” attack vector in enforcement actions against companies that failed to protect customer data.And yet, in 2014—sixteen years after the first public disclosure, eleven years after the FTC’s warning—Yahoo’s database servers remained vulnerable.The reason was not that Yahoo’s engineers were unaware of SQL injection. They were. The reason was not that Yahoo lacked the resources to fix the vulnerability. They had thousands of engineers and a security budget that ran into the tens of millions of dollars.
The reason was something far more mundane and far more common in large organizations: legacy code, organizational silos, and the slow decay of security as a priority when other pressures—product launches, revenue targets, executive bonuses—took precedence.The vulnerable database was old. It had been built in the early 2000s, during Yahoo’s heyday as the dominant web portal, and had been patched and expanded and migrated across servers without ever being fundamentally rebuilt. The code that queried this database used string concatenation rather than parameterized queries—a classic SQL injection risk. Over the years, different teams had added features to the user account system. Customer support had requested the ability to look up security answers directly, to verify user identities during phone calls.
Product managers had added new security questions to meet emerging compliance requirements. At no point had anyone conducted a comprehensive security review of the entire authentication pipeline.This is not an excuse. It is an explanation. Large systems become complex. Complexity breeds blind spots.
Blind spots, when combined with motivated attackers, become breaches.How SQL Injection Actually Works (For Non-Programmers)For readers who are not database administrators or software engineers, it helps to understand exactly what SQL injection does. Imagine you are filling out a web form that asks for your username. Behind the scenes, the website constructs a database query that looks something like this:SELECT * FROM users WHERE username = ‘[whatever you typed]’If you type “jsmith,” the query becomes:SELECT * FROM users WHERE username = ‘jsmith’This is harmless. The database looks for a user named jsmith and returns that row.But if you are an attacker, you do not type “jsmith.” You type something like this:jsmith’ OR ‘1’=’1Now the query becomes:SELECT * FROM users WHERE username = ‘jsmith’ OR ‘1’=’1’Because the condition ‘1’=’1’ is always true, the database returns every user in the table. You have just bypassed the login form.
You do not need a password. You do not need to know anyone’s username. You simply tricked the database into giving you everything.Now imagine you have more ambitious goals. Instead of just logging in, you want to steal data. You type:jsmith’; DROP TABLE users; —The — tells the database to ignore everything after it.
The query becomes:SELECT * FROM users WHERE username = ‘jsmith’; DROP TABLE users;The database executes the first command (look for jsmith) and then the second command (delete the entire users table). You have just destroyed the website’s user database.The attacker who breached Yahoo used a variation of this technique—not to delete data, but to extract it. They issued a UNION query, which combines the results of two or more SELECT statements into a single result set. The legitimate query might have been designed to return a single user’s profile data. The injected query appended a second command that returned every row from the security questions table.
The database, unable to distinguish between the intended query and the attacker’s addition, obediently returned everything.Why Parameterized Queries Would Have Stopped the Attack The solution to SQL injection has been known for decades: parameterized queries (also called prepared statements). Instead of building a query by concatenating strings—which allows an attacker to inject malicious code—a parameterized query separates the query structure from the user input.Here is the difference in practice. A vulnerable query looks like this (pseudocode):query = “SELECT * FROM users WHERE username = ‘“ + user Input + “’”An attacker can break out of the quotes and inject SQL.A parameterized query looks like this:query = “SELECT * FROM users WHERE username = ?”parameters = [user Input]The database knows that the ? is a placeholder for data, not for code. No matter what the user types—including jsmith’ OR ‘1’=’1—the database treats it as a literal string, not as executable SQL.
The attack fails.Parameterized queries are not new. They have been a standard feature of every major database and programming language…
This is the end of the free sample. Get the eBook to keep going. Buy now
About this book
Details
- Author
- Booth Lenita
- Publisher
- SamEnrico
- Language
- English
- Genre
- Non-Fiction, True Crime, Poor Security Practices
- Released
- 2026-06-06
- Pages (approx.)
- 139
- Available as
- eBook, Audiobook
Read better in the ZLOADR app
Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.
More by Booth Lenita
QMS Implementation Gantt ChartBooth Lenita$11.99
Isaac Asimov BioBooth Lenita$11.99
Teen Boundary ConversationBooth Lenita$11.99
Intergroup Service in Twelve StepsBooth Lenita$11.99
Gig Platform City ComparisonBooth Lenita$11.99
Nonprofit Operations From Corporate GuideBooth Lenita$11.99
Plank Hold GuideBooth Lenita$11.99
The Poet and the Pedal: Thomas Green's Forbidden Symphony of the 1866 OlympicsBooth Lenita$11.99
The Silk Road Scrolls: The Secret Photographs of the Han DynastyBooth Lenita$11.99
How to Start a Analytical Chemist Business (Beginners Guide)Booth Lenita$11.99
Growing AlyogyneBooth Lenita$11.99
A Collector's Handbook to the Panhard Dyna JuniorBooth Lenita$11.99