SQL Slammer
A 376-byte worm in a single UDP packet infected most vulnerable servers in 10 minutes, exploiting a bug patched six months earlier.
- Severity
- Front-page news
- Difficulty
- beginner
- Companies
- Microsoft, Bank of America, KT
- Tech
- Microsoft SQL Server, MSDE, UDP, Buffer overflow
- Root cause
- unpatched flaw, memory safety
The story
Quick (1 min)
Just before 05:30 UTC on Saturday 25 January 2003, a tiny worm called SQL Slammer (also called Sapphire) began spreading. It became the fastest computer worm in history at that point.
The whole worm was just 376 bytes and fit in a single network packet. It attacked a bug in Microsoft SQL Server. Each infected server picked random internet addresses and fired copies at them as fast as it could. The number of infected machines doubled every 8.5 seconds, and over 90% of vulnerable machines were infected within 10 minutes.
It didn't steal or destroy anything, but the flood of traffic overloaded networks. Bank of America ATMs stopped working, flights were cancelled, and much of South Korea's internet went down. Microsoft had released a patch six months earlier.
The lesson: unpatched internet-facing services are the easiest target, and automated attacks move faster than any human response.
Keep reading to the end to earn XP.Read. XP earned.
Engineer (1 min)
The vulnerability. A buffer overflow in the SQL Server Resolution Service on UDP port 1434, in Microsoft SQL Server 2000 and MSDE 2000. Microsoft reported it on 24 July 2002 (MS02-039, CVE-2002-0649) with a patch. David Litchfield, who found the bug, had shown proof-of-concept code at Black Hat.
Why it was so fast:
- UDP, one packet: no handshake needed. The entire 376-byte worm fits in one datagram, so infected hosts just "fire and forget."
- Random scanning: each host picked random IPs and sent packets as fast as its bandwidth allowed. The worm hit a full scanning rate of over 55 million scans per second after about three minutes (CAIDA).
- Doubling time 8.5 seconds, about two orders of magnitude faster than Code Red (2001), which doubled about every 37 minutes.
Memory-only. It didn't write itself to disk; restarting SQL Server removed it, though machines were usually reinfected immediately.
Collateral damage. It carried no malicious payload, but bandwidth saturation and router crashes caused outages. CAIDA said at least 75,000 hosts were infected, "perhaps considerably more."
Interview takeaway: patch latency is the real vulnerability. Don't expose database services to the internet, and filter unused ports at the network edge.
Keep reading to the end to earn XP.Read. XP earned.
Deep dive (2 min)
Timeline
- 24 July 2002: Microsoft reports the SQL Server vulnerability and releases a patch (MS02-039) (Wikipedia).
- 25 January 2003, slightly before 05:30 UTC: Slammer begins infecting hosts (CAIDA).
- First minute: the infected population doubles every 8.5 (±1) seconds.
- ~3 minutes: full scanning rate of over 55 million scans per second; growth then slows as networks saturate.
- ~10 minutes: more than 90% of vulnerable hosts infected.
- Following hours: router crashes and congestion slow the internet; ISPs and organisations filter UDP 1434.
Impact (CAIDA, Wikipedia)
- At least 75,000 infected hosts.
- A majority of Bank of America's 13,000 ATMs couldn't process transactions.
- In South Korea, almost all customers of KT, one of the two largest ISPs, lost connectivity.
- Cancelled airline flights and interference with elections (CAIDA).
- Many unpatched installations were at Microsoft itself (Wikipedia).
Why routers fell over
Wikipedia explains some routers crashed under the traffic instead of dropping packets. Neighbouring routers then updated their routing tables to avoid them, and again when they came back, adding routing churn on top of the flood.
CAIDA's warning
"If the worm had carried a malicious payload, had attacked a more widespread vulnerability, or had targeted a more popular service, the effects would likely have been far more severe."
What changed
Slammer became the textbook demonstration that a worm can outrun human response, making automated defences, port filtering and fast patch deployment essential.
Keep reading to the end to earn XP.Read. XP earned.
Failure replay
Step by step, what broke and what it hit next. Showing the key steps. Switch to Engineer or Deep dive for every step.
- Jul 2002SQL Server patchhealthy
Microsoft patches a buffer overflow in SQL Server's UDP 1434 service. Many servers never install it.
Affects: Unpatched SQL servers
- Jan 25, ~05:30 UTCSlammer wormcompromised
A single 376-byte UDP packet hits a vulnerable server and overflows its buffer. The worm runs in memory.
Affects: Unpatched SQL servers
- First minuteUnpatched SQL serverscompromised
Each infected server fires packets at random IPs as fast as it can. Infections double every 8.5 seconds.
Affects: Internet links
- ~3 minutesInternet linksfailing
Scanning reaches over 55 million probes per second. Links saturate and some routers crash.
Affects: Banks and ISPs
- ~10 minutesUnpatched SQL serversdown
Over 90% of vulnerable hosts are infected, at least 75,000 machines.
- HoursBanks and ISPsdown
Bank of America ATMs fail, flights are cancelled, and KT customers in Korea lose internet access.
- Hours–daysInternet linksrecovering
Networks block UDP 1434 and admins patch and restart SQL servers.
Impact
- Who was affected
- At least 75,000 SQL Server/MSDE hosts; collateral outages including Bank of America ATMs, KT's customers in South Korea, airline systems and wider internet slowdowns.
- How long
- Most vulnerable machines infected within 10 minutes on 25 January 2003; network disruption lasted hours.
- Cost
- not disclosed
Lessons
- Patches only help if applied; Slammer exploited a six-month-old fix.
- Don't expose database services directly to the internet.
- Filter unneeded ports at the network edge by default.
- Automated attacks outrun human response; defences must be automatic too.
- Network equipment should degrade gracefully under floods, not crash.
Quiz
How big was the SQL Slammer worm?
The answer is 376 bytes, a single UDP packet. The entire worm fit inside one 376-byte packet.
Check answer
376 bytes, a single UDP packet. The entire worm fit inside one 376-byte packet.
How quickly did the infected population double in the first minute?
The answer is Every 8.5 seconds. CAIDA measured a doubling time of about 8.5 seconds; Code Red took about 37 minutes.
Check answer
Every 8.5 seconds. CAIDA measured a doubling time of about 8.5 seconds; Code Red took about 37 minutes.
How long had a patch been available when Slammer hit?
The answer is About six months. Microsoft released MS02-039 in July 2002; Slammer struck in January 2003.
Check answer
About six months. Microsoft released MS02-039 in July 2002; Slammer struck in January 2003.
Slammer carried no destructive payload. Why did it still cause outages?
The answer is Its scanning traffic saturated networks and crashed routers. Bandwidth saturation and router failures caused the ATM, airline and ISP disruptions.
Check answer
Its scanning traffic saturated networks and crashed routers. Bandwidth saturation and router failures caused the ATM, airline and ISP disruptions.
Interview prep
Try answering out loud before you open the model answer.
- security
Why did SQL Slammer spread roughly 100 times faster than Code Red?
Show model answer
Slammer used UDP and fit entirely in one 376-byte packet, so infecting a host needed no connection setup. Infected machines just blasted packets at random addresses as fast as bandwidth allowed, reaching 55 million scans per second. Code Red used TCP, which needs handshakes, so each attempt was slower. Slammer doubled every 8.5 seconds compared with about 37 minutes for Code Red. Its speed was eventually limited by bandwidth, not by how long infections took.
A strong answer hits:
- UDP, single packet, no handshake
- Random scanning at line rate
- Bandwidth became the limit
- TCP worms are slower per attempt
How did your answer compare? - system design
Your company runs internet-facing services. What controls would have prevented Slammer from affecting you?
Show model answer
Network exposure: database ports such as UDP 1434 should never be reachable from the internet, so default-deny at firewalls and segment database tiers. Patch management: track critical patches with SLAs, and inventory everything, including embedded MSDE instances people forget about. Monitoring: alert on unusual outbound traffic from servers. Resilience: rate limiting and router configurations that drop excess traffic instead of crashing.
A strong answer hits:
- Default-deny firewalls and segmentation
- Patch SLAs and complete asset inventory
- Outbound traffic monitoring
- Graceful network degradation
How did your answer compare? - behavioural
A patch for a critical vulnerability has been available for months but teams haven't applied it. How do you get it done?
Show model answer
Make the risk concrete: Slammer hit organisations six months after the patch, including Microsoft. Find what's blocking teams (fear of breaking things, no maintenance window, unknown systems) and remove those blockers: test environments, automated rollout, agreed windows. Set clear SLAs by severity and report compliance to leadership. If patching truly can't happen soon, apply compensating controls such as blocking the port.
A strong answer hits:
- Make the risk concrete with real cases
- Remove blockers (testing, automation, windows)
- Severity-based SLAs and visibility
- Compensating controls
How did your answer compare?
Go deeper
- Official reportThe Spread of the Sapphire/Slammer WormCAIDA, link checked 2026-11-25
- ArticleSQL SlammerWikipedia, link checked 2026-11-25