Key takeaway
- Code Red worm explained: the 2001 IIS exploit (MS01-033), how it spread, what CERT/CC advised, and the patching lessons for security leaders.
What was the Code Red worm?
Code Red was a self-propagating worm that began spreading on 13 July 2001 by exploiting a buffer overflow in the Indexing Service of Microsoft Internet Information Services (IIS). According to CERT Advisory CA-2001-19, it scanned for hosts listening on TCP port 80, sent a crafted HTTP GET request, and, on English-language systems, defaced web pages with the text "HELLO! Welcome to http://www.worm.com! Hacked By Chinese!".
The vulnerability had a patch before the worm appeared: Microsoft Security Bulletin MS01-033 was published on 18 June 2001. Code Red is therefore remembered less for its code than for what it showed about unpatched, internet-facing servers. This guide covers what the worm did, how it spread, what CERT/CC and Microsoft advised, and what enterprise security leaders can still take from it. For a current view of controls, see our guides on zero trust security architecture and agentic AI cybersecurity.
Which vulnerability did Code Red exploit?
Microsoft describes the flaw as an unchecked buffer in the idq.dll ISAPI extension, which handles input URLs for Index Server and the Indexing Service. According to Microsoft Security Bulletin MS01-033, an attacker with a web session to an affected server could cause a buffer overrun before any credential check, and run code in the Local System context, which gives full control of the server. The bulletin lists the CVE identifier as CAN-2001-0500 and credits eEye Digital Security with reporting it.
| Item | What the official source says | Source |
|---|---|---|
| Affected products | Microsoft Index Server 2.0 (Windows NT 4.0 Option Pack), Indexing Service in Windows 2000, and Windows XP beta versions before Release Candidate 1 | MS01-033 |
| Default exposure | Windows 2000 Server default installations are vulnerable; Windows NT 4.0 and Windows 2000 Professional defaults are not, but IIS installed manually makes them vulnerable | MS01-033 |
| Needs the service running? | No. The flaw is exploitable while the .idq or .ida script mappings exist and IIS is running | MS01-033 |
| Workaround | Remove the .ida and .idq script mappings in IIS. Microsoft notes that adding or removing Windows components can restore them, so it recommends applying the patch regardless | MS01-033 |
| Fix | Patch Q300972 for Windows NT 4.0 and Windows 2000; the fix is included in Windows 2000 Service Pack 3 | MS01-033 |
How did Code Red spread and what did it do?
On infection, the worm checks for the file c:\notworm and stops if it exists. Otherwise it starts threads that scan random IP addresses for vulnerable hosts (CERT Advisory CA-2001-19). Because every instance used the same random number generator seed, infected hosts scanned the same list of addresses, which CERT/CC warned could cause a denial of service against the addresses earliest in the list. CERT/CC's follow-up advisory on the continued threat of Code Red also notes that the defacement text exists only in memory, so searching the file system may not reveal a compromise.
Behaviour followed the day of the month, as described by CERT/CC:
| Day of month | Behaviour | Source |
|---|---|---|
| 1st to 19th | Infected hosts scan random IP addresses on TCP port 80 to spread | CERT/CC follow-up advisory |
| 20th to 27th | Infected hosts launch a packet-flooding denial-of-service attack against a specific IP address embedded in the code | CERT/CC follow-up advisory |
| After the 27th | The worm stays in memory but is inactive | CERT/CC follow-up advisory |
Scale: the same CERT/CC follow-up advisory reports more than 250,000 systems infected in about nine hours on 19 July 2001 and at least 280,000 hosts in the first wave. The CAIDA case study of the worm counts more than 359,000 internet-connected computers infected on 19 July 2001. Counts differ because they come from different measurements. CERT/CC also expected the worm to resume spreading on 1 August 2001 because some infected systems had incorrect clocks. The target address of the flood is described only as a specific IP address in these advisories; confirm on the official page before naming a host.
Side effects reached beyond IIS. CERT/CC reports that unpatched Cisco 600-series DSL routers stopped forwarding packets after processing the worm's request, and that non-IIS web servers on port 80 would typically answer with HTTP 400 Bad Request and might log it.
What did the Code Red variants change?
CERT/CC reports at least two variants in the first wave: the earlier one defaced pages on English-language hosts, while the later one did not change page content. A separate worm, Code Red II, exploited the same IIS Indexing Service flaw; CERT/CC covered it in incident note IN-2001-09, titled "Code Red II: Another Worm Exploiting Buffer Overflow in IIS Indexing Service DLL". Its backdoor behaviour and any other variant names (for example "CodeBlue" or "CodeGreen") are not covered by the advisories we read in full, so confirm them on the official CERT/CC page before relying on them.
How was Code Red stopped, and which controls still matter?
The primary advice in CERT Advisory CA-2001-19 was to apply the workarounds or patches from the underlying advisory on every affected host. CERT/CC's follow-up adds good-practice network controls. The table maps each to a modern equivalent.
| 2001 advice (source) | What it addressed | Modern equivalent for enterprise teams |
|---|---|---|
| Apply the MS01-033 patch, or remove the .ida and .idq mappings (Microsoft) | Known flaw on exposed web servers | Asset inventory, patch service levels by exposure, and removal of unused components |
| Review and patch all affected hosts on your network (CERT/CC) | Unpatched internal and external servers | Continuous vulnerability management with named owners |
| Ingress filtering at the network edge (CERT/CC) | Outside instances reaching internal machines not meant to be public | Network segmentation and default-deny exposure, as in a zero trust design |
| Egress filtering (CERT/CC) | Compromised public servers sending worm traffic outward | Outbound traffic controls and monitoring from servers |
| Reboot a compromised host, take it offline, then patch (CERT/CC) | The worm lives in memory, so a reboot clears it, but reinfection is likely | Isolate first, remediate the cause, then restore |
| Patch new software before connecting it to the network (CERT/CC) | New systems exposed while unpatched | Hardened build images and pre-deployment checks |
What should enterprise leaders take from Code Red today?
First, the gap between a published patch and a mass infection was about a month (MS01-033 on 18 June, spread from 13 July 2001). The lesson is operational: know which systems are exposed and who owns patching them. Second, a worm that lives only in memory defeats file-based checks, so monitoring has to include network behaviour, as covered in our guide to self-healing SOC systems.
Third, the same discipline now applies to autonomous AI agents that hold credentials and call tools: each needs a defined scope, policy and an audit trail. According to its page, Elixir Govern (formerly AgentGRC) keeps AI agent actions inside policy with audit-ready records, and ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents. These are governance layers, not a defence against a 2001 worm.
Limits of this history: Code Red targeted a specific product line for which Microsoft issued a patch in 2001, so treat the advisories as a record of attack mechanics and response, not as a current checklist for IIS.
To map one security or patching decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
Code Red worm FAQ
What is the Code Red worm?
Code Red is a self-propagating worm that began spreading on 13 July 2001 by exploiting a buffer overflow in the Indexing Service of Microsoft IIS, according to CERT/CC advisories.
Which Microsoft bulletin covers the Code Red vulnerability?
Microsoft Security Bulletin MS01-033, published on 18 June 2001, covers the unchecked buffer in the idq.dll ISAPI extension, identified as CAN-2001-0500.
What did Code Red do to infected servers?
It scanned random IP addresses on TCP port 80 to spread, defaced pages on English-language systems with a fixed message, and, from the 20th to the 27th of the month, flooded a specific IP address, as described by CERT/CC.
How many systems did Code Red infect?
CERT/CC reports more than 250,000 systems infected in about nine hours on 19 July 2001, and CAIDA counts more than 359,000 computers that day. The figures differ because the measurements differ.
How do you stop a worm like Code Red?
CERT/CC advised patching affected hosts, ingress and egress filtering, and patching new software before connecting it to the network. For an infected host, a reboot clears the memory-resident worm but reinfection is likely until the patch is applied.
Is Code Red still a threat?
The advisories cover unpatched IIS 4.0 and 5.0 systems from 2001. Patched, supported systems are not affected by that flaw, so the main value today is the lesson on patching, exposure and monitoring.
Ready to put AI agents to work? See an ElixirClaw demo: the agentic OS to build, orchestrate and govern AI agents across your enterprise systems.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE