Packet Path/

WannaCry and the NHS: The Patch That Was Sent Twice

On Friday 12 May 2017, WannaCry — ransomware that locks a computer's data and demands payment to unlock it — became the largest cyber attack ever to affect the NHS in England. Every organisation it infected shared one weakness: an unpatched or unsupported Windows system. Microsoft had issued a patch in March 2017, and NHS Digital had told organisations to apply it in critical alerts on 17 March and again on 28 April. Nobody had a way to check who actually had. At least 80 of 236 trusts were affected and 595 GP practices were infected. This is the documented story, from the UK National Audit Office's investigation, HC 414.

Case Studies · Intermediate · 12 min · November 17, 2026

Editorial illustration on a dark teal background: a hospital ward corridor at night with rows of computer screens glowing with padlocks, one amber warning envelope unopened on a desk in the foreground, and a green shield outline over the hospital entrance.

The short answer

On Friday 12 May 2017, a ransomware program called WannaCry — software that encrypts (locks) the data on infected computers and demands a ransom payment to give access back — was released worldwide and became the largest cyber attack to affect the NHS in England. The National Health Service (NHS) was not the specific target. Every NHS organisation it infected shared the same weakness: unpatched or unsupported Windows operating systems. Microsoft had issued a patch (a software update that fixes a known hole) in March 2017, and NHS Digital had issued critical alerts telling organisations to apply it. Whether an organisation had patched or not, the National Audit Office (NAO) found, managing its internet-facing firewalls would have guarded it against infection. In total at least 80 out of 236 trusts in England were affected, and a further 603 primary care and other NHS organisations were infected, including 595 GP practices. No NHS organisation paid the ransom, and the Department of Health does not know what the disruption cost. The head of the NAO called it a relatively unsophisticated attack that could have been prevented by following basic IT security best practice.

The company: what the NHS in England did

The NHS provides health care across England. Care is delivered locally: 236 trusts and foundation trusts (the local organisations that run hospitals and other services), 209 clinical commissioning groups (the bodies that plan and buy local services), GP (family doctor) practices, and other providers. If you live in England, your hospital, your GP and your ambulance service each sit inside one of these local organisations — there is no single NHS computer system they all share.

That structure is the heart of this case. The Department of Health (the Department) held overall national responsibility for cyber-security resilience, but it devolved day-to-day cyber-security to the local organisations. National bodies supported them: NHS Digital issued guidance, alerts and on-site assessments — its alert emails are called CareCERT alerts — and ran the N3 network, the broadband network connecting all NHS sites in England, plus national systems such as the NHS Spine (secure databases of demographic and clinical information) and NHSmail. But NHS Digital could not mandate a local body to take remedial action, even when it had concerns about that organisation's vulnerability. It could advise. It could not compel, and before May 2017 it could not even check.

One fact in the NHS's favour, recorded by the NAO: those national systems held. NHS Digital told the NAO that the Spine and NHSmail were not infected, and WannaCry did not spread by NHSmail. What failed was not the centre. It was hundreds of local estates, each defended — or not — on its own.

The problem: the warnings were sent, and nobody could check who listened

WannaCry did not arrive unannounced. The NAO documents a three-year trail of warnings, each one reasonable, none of them wired to a check.

First, the old-software warning, 2014. The Department and the Cabinet Office wrote to trusts in 2014 saying it was essential they had "robust plans" to migrate away from old software such as Windows XP by April 2015, after which temporary support help would end. Microsoft no longer released patches for Windows XP, so an XP machine could not be fixed against a new attack — it could only be isolated (cut off from the network). Despite the letter, on 12 May 2017 about 5 percent of the NHS IT estate, including computers and medical equipment, was still using Windows XP. Some of that equipment — the NAO gives MRI scanners as the example — has Windows XP embedded inside it, is managed by the equipment vendor rather than the trust, and cannot simply be updated by local staff.

Second, the formal reviews, July 2016. The Secretary of State for Health asked the National Data Guardian and the Care Quality Commission to review data security. Their reports, published in July 2016, warned the Department that cyber attacks could lead to patient information being lost or compromised and could jeopardise access to critical patient record systems, and recommended that health and care organisations provide evidence they were improving cyber-security, including moving off old operating systems. The Department had work under way — but it did not publish its formal response to those recommendations until July 2017, two months after WannaCry.

Third, the patch alerts, March and April 2017. This is the sharpest fact in the report. NHS Digital told the NAO that the majority of infected NHS devices were unpatched but running supported Windows 7 — not antiques, but ordinary machines (more than 90 percent of NHS devices used Windows 7) missing one update. Microsoft issued the patch in March 2017, and NHS Digital issued CareCERT alerts on 17 March and 28 April 2017 asking trusts to apply it. The patch existed. The instruction was sent twice. What did not exist, before 12 May, was any formal mechanism for assessing whether local organisations had complied.

And the assessments said so. NHS Digital offered a voluntary on-site cyber-security inspection, CareCERT Assure. By 12 May it had inspected 88 out of 236 trusts — and none had passed. The centre also held limited information about local readiness: it did not know whether cyber-security sat on trusts' risk registers, and it had no central record of trusts' IT assets, anti-virus software or IP addresses. When the National Crime Agency began its investigation, it had to gather basic evidence — devices affected, IP addresses, network traffic — site by site, because none of it was held centrally.

An analogy: a head office emails every branch, twice, saying "fit the new lock before spring, burglars are active." It never asks for the receipt, never visits to check, and its own inspectors have already failed every branch they visited — with no power to make a branch act. Spring comes. The branches with the old locks are not hard to find; the burglar just tries every door.

Two doors — either one, closed, was enough WANNACRY ARRIVES Released worldwide Friday 12 May 2017 Spreads via the internet DOOR 1 — THE PATCH Microsoft patch, March 2017 DOOR 2 — THE FIREWALL Manage the internet-facing firewall GUARDED EITHER WAY The NAO: firewall action would have guarded trusts patched or not EVERY INFECTED TRUST HAD BOTH DOORS OPEN Unpatched, or unsupported, Windows — the one shared vulnerability Defence in depth means the second door does not depend on the first one being remembered.

What this shows: the NAO's central finding in one picture. Patching and firewall management were independent defences — an organisation needed only one of them, and every infected organisation had neither in place.

What happened on 12 May 2017

All times and figures are from the NAO report, which covers the NHS in England for the week from 12 to 19 May 2017. Globally, the report records, WannaCry affected more than 200,000 computers in at least 100 countries; this page follows only its documented path through the NHS.

12 to 19 May 2017 — the documented week Morning, Friday 12 May — the attack begins WannaCry spreads via the internet, including through the N3 network 4:00 pm, 12 May — major incident declared NHS England implements its emergency arrangements; EPRR coordination follows at 6:45 pm Evening, 12 May — the kill switch A cyber-security researcher activates it; WannaCry stops locking devices Weekend 13–14 May — the overtime shift Staff work to stop a fresh wave on Monday; NHS Digital sends 54 staff to hospitals Tuesday 16 May — two hospitals still diverting Lister Hospital in Hertfordshire and Broomfield Hospital in Essex Friday 19 May — incident stood down NHS England stands the major incident down at 5:30 pm

What this shows: one week, as the NAO documents it. The two moments that bent the curve were both on day one — the major-incident declaration in the afternoon and the kill switch that evening.

The morning. WannaCry reached NHS machines and began locking them. NHS Digital told the NAO the ransomware spread via the internet, including through the N3 network, and that it exploited weaknesses within parts of Microsoft's Windows operating system used to share files within organisations — which meant, in the NAO's words, that it spread automatically in some cases, and organisations with large Windows networks were among the worst affected. It did not spread through NHSmail. Staff at infected trusts found themselves locked out of devices, unable to access or update patient information, send test results to patients' GPs, or transfer and discharge patients. Medical equipment was locked too, or isolated from trust systems to protect it, disrupting radiology and pathology work such as diagnostic imaging and blood and tissue testing.

4:00 pm — a major incident. NHS England declared the cyber attack a major incident and implemented its emergency arrangements to maintain health and patient care. At 6:45 pm it initiated its existing Emergency Preparedness, Resilience and Response (EPRR) plans as the single point of coordination for incident management, with support from NHS Digital and NHS Improvement. The Department coordinated with the centre of government, briefing ministers and liaising with the National Cyber Security Centre and the National Crime Agency. But the plan had never been rehearsed for this: the NAO records that it was not immediately clear who should lead the response, that local organisations reported the attack to different places — including, in some cases, the local police — and that because a cyber attack is less visible than a transport accident and not confined to one area, it took longer to work out the cause, the scale, and how many organisations and people were affected.

The evening — the kill switch. On the evening of 12 May, a cyber-security researcher activated a kill switch — the NAO defines it as a mechanism built into software to shut that software down in an emergency — so that WannaCry stopped locking devices. (The report does not name the researcher, and neither does this page.) Organisations infected after that point carried the malware but were not locked out. Timing explains the map: of the 34 trusts infected and locked out, 29 were in the North region and the Midlands and East region, and NHS England believes more organisations were infected there because they were hit early on 12 May, before the kill switch was activated.

How it spread — and what stopped the locking ONE INFECTED PC Unpatched Windows FILE-SHARING HOLE Spreads automatically THE WHOLE ESTATE Large networks hit worst EVENING, 12 MAY — KILL SWITCH ACTIVATED WannaCry stops locking devices; later infections do not lock The moving dashed lines are the automatic spread the NAO describes. The kill switch stopped the locking — it did not patch a single machine.

What this shows: why this attack moved at network speed. It did not need anyone to click anything inside the estate — it used the file-sharing weakness to copy itself from machine to machine, which is why the evening kill switch mattered so much.

The weekend, 13–14 May. National and local staff worked overtime, including over the weekend, to resolve problems and to prevent a fresh wave of organisations being affected on Monday 15 May. NHS Digital sent 54 staff out to hospitals to provide direct support, and affected trusts were triaged through the EPRR route. NHS England's own IT team had no on-call arrangements in place; its staff came in voluntarily. Communication was improvised: many local organisations could not email national bodies because they were infected or had shut email down as a precaution, NHS Improvement reached trusts' chief executives by telephone, and front-line staff shared information through personal mobile devices, including the encrypted WhatsApp application — not an official channel, the NAO notes, but one national bodies and trusts said worked well. On 14 May, NHS England and NHS Digital wrote to all trusts advising against paying ransoms — advice that, the report notes dryly, did not always reach trusts whose email was down.

The recovery week. NHS England focused first on maintaining emergency care, and within 24 hours on primary care — helped by the calendar, since the attack landed on a Friday and GP services are mostly closed over a weekend. By Tuesday 16 May only two hospitals were still diverting patients: Lister Hospital in Hertfordshire and Broomfield Hospital in Essex. On Friday 19 May NHS England stood the incident down. The tail ran longer than the incident: between 15 May and mid-September, NHS Digital and NHS England identified a further 92 organisations, including 21 trusts, contacting the WannaCry domain — some, the NAO cautions, possibly as part of their own security activity rather than fresh infection.

The damage

The counts — read them as the NAO layers them, because they measure different things. On 12 May, NHS England initially identified 45 NHS organisations, including 37 trusts, as infected; three of those trusts were later re-categorised as not infected but experiencing disruption. The fuller picture: at least 80 out of 236 trusts were affected — 34 infected and locked out of devices (25 of them acute trusts, the ones running emergency hospitals) and 46 not infected but reporting disruption. That is disruption in at least 34 percent of trusts in England — and the NAO is explicit that even this understates it, because the Department does not know how many organisations lost access simply by sharing data or systems with an infected trust. A further 21 trusts were found attempting to contact the WannaCry domain without being locked out. Beyond the trusts, 603 primary care and other NHS organisations were infected, including 595 GP practices.

Why the uninfected were disrupted too. The NAO lists three routes, and all three are lessons in themselves. Some trusts, receiving no timely central direction early on 12 May, shut down or isolated their own systems as a precaution — and worked on pen and paper. Some lost access to electronic patient records or test results because they shared data or systems with an infected trust that had shut down. And some disconnected from the N3 network to protect themselves, cutting their own links in the process. Roughly half the affected trusts were, in effect, casualties of their own sensible precautions and of shared systems — the blast radius of an incident is set by your connections, not just your own patching.

Patients. Between 12 and 18 May, NHS England identified 6,912 cancelled appointments — a partial count, excluding some appointment types and anything identified after 18 May — and estimated the true total at about 19,494, based on the normal rate of follow-up appointments. Neither the Department nor NHS England knows how many GP appointments were cancelled; they were never counted. At least 139 patients who had an urgent referral for potential cancer had that referral cancelled, as at 18 May. Five accident and emergency departments had to divert patients to travel further: the Royal London Hospital (Barts Health NHS Trust), Broomfield Hospital in Essex (Mid Essex), Lister Hospital in Hertfordshire (East and North Hertfordshire), Basingstoke Hospital in Hampshire (Hampshire Hospitals) and West Cumberland Hospital in Cumbria (North Cumbria). Against that, 20 of the 25 infected acute trusts kept treating urgent and emergency patients throughout the weekend, and two more continued with outside help. As at 19 May, 1,220 pieces of diagnostic equipment had been infected — 1 percent of all such NHS equipment, not counting equipment disconnected to protect it — and trusts described being unable to send MRI scan results to clinicians elsewhere in the hospital.

Money — the honest blank. The Department, NHS England and the National Crime Agency all told the NAO that no NHS organisation paid the ransom. And the total cost? The NAO's finding is that the Department does not know. The costs of cancelled appointments, of staff overtime, of additional IT support and consultants, and of restoring data and systems — including re-entering by hand the data staff had recorded on paper while systems were down — were never calculated. Any precise-sounding total cost for WannaCry in the NHS that you meet elsewhere did not come from the official investigation, because the official investigation says the number was never worked out.

What did not happen. NHS organisations reported no cases of harm to patients, and NHS Digital told the NAO it believes no patient data were compromised or stolen — while being candid that analysis suggested the attack was not aimed at stealing data, but that it does not know that for certain. The damage was availability, not theft: records nobody could open, equipment nobody could use, appointments nobody could keep.

How they recovered

Step one: protect emergency care first. Following its existing major-incident procedures, NHS England focused its initial response on maintaining emergency care and worked with trusts to put patient diverts in place and get help to the trusts that needed it. Twenty of the 25 infected acute trusts treated urgent and emergency patients all weekend; the five that diverted were down to two by 16 May.

Step two: the kill switch bought time. The researcher's evening activation meant that from the night of 12 May, new infections no longer locked devices. Recovery teams were no longer racing a still-spreading locker — they were cleaning up a stopped one. The NAO is plain that the attack could have caused more disruption without it.

Step three: a weekend of manual work. Staff worked through 13–14 May patching and remediating so Monday did not start a second wave, supported by the 54 NHS Digital staff sent to hospitals. Trusts rolled back systems and restored data, including re-entering what had been recorded on paper.

Step four: stand down, then count. NHS England stood the incident down on 19 May. The slower work — identifying every organisation that had contacted the WannaCry domain, and confirming who had actually implemented the outstanding alerts — continued into September and fed directly into the fix list below.

The fix: technology and controls that came out of it

The NAO records the lessons in the NHS's own terms, and they read as a checklist any large, federated organisation can steal.

Verify compliance — do not just send the alert. The single structural failure was the gap between advice and assurance. On 12 May itself, NHS England and NHS Digital put in place the formal mechanism that had been missing: emergency teams required a positive return from providers by midnight on 12 May confirming, for example, that an unattacked organisation had implemented the patch, or that an attacked one had completed remedial works, rolled back its systems, and could still provide emergency services or had mitigations in place. After the attack, NHS Digital built a CareCERT Collect portal to collect exactly that assurance centrally, along with central data on the NHS's IT and digital assets — the inventory whose absence had forced investigators to gather evidence site by site.

Close both doors: patch, and firewall. The technical lesson is the NAO's own pairing. Organisations must implement critical CareCERT alerts — applying software patches and keeping anti-virus software up to date — and the report stresses the independent second control: managing internet-facing firewalls would have guarded organisations whether or not they had patched. Patching is a race you will sometimes lose; a correctly managed boundary does not care which specific hole is fashionable this month. For the machines that cannot be patched — the XP-embedded medical devices — the report's answer is isolation from the network, accepting the manual workarounds that isolation forces.

Finish the migration off unsupported software. In its July 2017 response, the Department told local bodies to ensure they had moved away from, or were actively managing, unsupported software by April 2018 — turning the 2014 letter's request into a dated commitment, three years and one national incident later.

Write the cyber response plan, assign the roles, and rehearse it. The lessons the Department and national bodies identified include developing a response plan that sets out what the NHS should do in a cyber attack and establishes the roles and responsibilities of local bodies, national bodies and the Department — the clarity whose absence cost hours on 12 May — and ensuring essential communications still get through when systems are down, so the next incident does not depend on personal phones and a consumer messaging app, however well they improvised this time.

Make boards own it, and fund the front line. The remaining lessons were cultural and financial: organisations, boards and staff taking the cyber threat seriously as a direct risk to front-line services, not an IT-department matter. Concretely, NHS England and NHS Improvement wrote to every trust, clinical commissioning group and commissioning support unit asking boards to ensure all 39 CareCERT alerts issued between March and May 2017 had been implemented and essential action taken to secure local firewalls; the 10 Data Security Standards were embedded in the standard NHS contract for 2017-18; and NHS England and NHS Improvement reprioritised £21 million of capital funding from existing IT budgets to improve cyber-security in major trauma centres, on top of the £50 million the Department had made available since 2015 for the CareCERT suite of services.

What this means for you

Enterprise network engineers

This is your case, and the broken thing is a process you probably own a piece of. The NHS had the patch, the alerts, the assessments and the plan — what it lacked was verification with teeth: an asset inventory, a compliance check that runs before the incident rather than at midnight during it, and an escalation path when a site simply does not act (88 assessments, zero passes, no power to mandate a fix). Translate it directly: know every device on your estate including the embedded and vendor-managed ones, isolate what cannot be patched, treat your internet-facing firewall rules as an independent control that must hold even when patching slips, and rehearse the incident plan — including how people will communicate when email is the thing that is down.

Hyperscaler engineers

You run the federated version of this problem: many semi-autonomous teams and tenants, one shared network, and advisories that land unevenly. WannaCry's spread is your lateral-movement scenario — it moved automatically through a file-sharing weakness, so the estates that suffered most were the large, flat, well-connected ones. The controls that map are segmentation (so one tenant's or team's unpatched corner cannot become everyone's outage), boundary enforcement that does not depend on every endpoint being current, and compliance telemetry that is continuous rather than a questionnaire. Note also the 46 trusts disrupted without being infected: in a shared platform, your customers' precautionary shutdowns and shared-service dependencies are part of your blast radius whether you count them or not.

HFT / low-latency engineers

Your estate is smaller and your patching windows are tighter, which makes the NHS failure mode more likely, not less: the deferred update, the legacy box nobody owns, the vendor appliance that cannot be touched mid-season. The transferable findings are the two independent doors — if a host cannot be patched on the attacker's timetable, its network exposure must be engineered so the patch does not matter — and the response lesson: an untested plan produced unclear leadership and improvised communications in an organisation of hundreds of thousands; in a trading firm it produces the same confusion at a hundred times the clock speed. The kill switch, finally, is a reminder that the fastest stop is the one built in before you need it — luck found this one, in someone else's code, on the evening of day one.

Try it yourself

The NAO's second door was the firewall: organisations that managed their internet-facing firewalls would have been guarded whether or not they had patched. You can practise that discipline with Packet Path's free ACL Analyzer: paste a firewall or router access-list and it flags the rules that are dead, shadowed, or wider than they need to be — the exact condition of a boundary that looks managed but is not. Pair it with the free Network Config Verifier, which compares device configurations side by side and flags inconsistencies: the verification habit — check that what should be true across the estate actually is — whose absence this whole case documents.

Sources

Primary source — UK National Audit Office, Investigation: WannaCry cyber attack and the NHS, HC 414, Session 2017-19 (report by the Comptroller and Auditor General, Sir Amyas Morse KCB, dated 24 October 2017; press release 27 October 2017). Every fact, figure, date and time on this page is taken from this investigation, which covers the NHS in England only: the global scale (more than 200,000 computers in at least 100 countries); the 2014 migration letter and April 2015 date; the July 2016 National Data Guardian and Care Quality Commission reviews and the Department's July 2017 formal response; the March 2017 Microsoft patch and the CareCERT alerts of 17 March and 28 April 2017; the 88 CareCERT Assure assessments with none passed; the spread via the internet and the N3 network through the Windows file-sharing weakness, with no spread via NHSmail and national systems (Spine, NHSmail) uninfected; the 4:00 pm major-incident declaration and 6:45 pm EPRR initiation on 12 May; the evening kill switch and the 29 of 34 locked-out trusts in the North and Midlands and East regions; the counts of at least 80 of 236 trusts affected (34 infected and locked out, including 25 acute trusts; 46 disrupted but not infected; a further 21 contacting the WannaCry domain), 603 primary care and other organisations infected including 595 GP practices, and disruption in at least 34 percent of trusts; the five diverting hospitals and the two still diverting on 16 May; 6,912 appointments identified as cancelled and the estimate of about 19,494; at least 139 urgent potential-cancer referrals cancelled; 1,220 pieces of diagnostic equipment infected (1 percent); no ransom paid by any NHS organisation and the total cost unknown; no reported patient harm and NHS Digital's belief that no patient data were compromised or stolen; the 54 NHS Digital staff sent to hospitals, the weekend working of 13–14 May, the 14 May anti-ransom letter, and the incident being stood down on 19 May; the further 92 organisations identified contacting the WannaCry domain between 15 May and mid-September; and the lessons and actions, including the midnight positive-return mechanism, the CareCERT Collect portal, the 39 CareCERT alerts, the April 2018 unsupported-software commitment, the 10 Data Security Standards in the 2017-18 contract, the £21 million reprioritised for major trauma centres and the £50 million made available since 2015. Report page: https://www.nao.org.uk/reports/investigation-wannacry-cyber-attack-and-the-nhs/ — full report PDF: https://www.nao.org.uk/wp-content/uploads/2017/10/Investigation-WannaCry-cyber-attack-and-the-NHS.pdf

No other sources are used for facts on this page. The NAO report does not name the kill-switch researcher, a patch bulletin number, an exploit name, or any ransom amount, so this page does not name them either; global WannaCry figures beyond the report's own are not used.

Key takeaways

Keep reading