AI and network security

Can an AI worm spread across a local network?

A worm is a program that copies itself from one system to the next without anyone running it. It can spread inside a local network if devices there run a service it can exploit or an AI assistant it can steer. What it cannot do is jump to devices it cannot reach, so a fleet that coordinates locally and touches the internet through one narrow gateway keeps an outbreak in the site where it started.

TL;DR

A worm spreads only to systems it can reach, by scanning for vulnerable services or, for AI worms, by planting self-replicating prompts in content assistants read. A fleet that coordinates locally and reaches the internet through one narrow gateway gives a worm no path between sites. Inside a site, authenticated peers, no open services and authorised requests limit its spread.

Learning objectives

After reading this article you will be able to:

  • Explain how classic worms such as WannaCry and Mirai, and AI worms such as Morris II, find and infect their next target
  • Describe what a local network with one narrow gateway changes about a worm's reach
  • Apply the controls that stop a worm spreading inside a site

Computer worm propagation

A worm spreads by reaching another system, getting it to run a copy of the worm, and repeating. NIST defines it as a self-replicating program that propagates itself through a network onto other computer systems without requiring a host program or any user intervention. Every worm needs the same two things: a way to find its next target, and a way to make that target run it.

The two best-known recent worms show both halves:

  • WannaCry (2017). CISA’s alert describes it scanning IP ranges on the local network, connecting over the Windows file-sharing ports, and, when port 445 answered, exploiting the SMBv1 flaw patched as MS17-010. Each infected machine became a new scanner.
  • Mirai (2016). Mirai continuously scanned the internet for IoT devices answering on Telnet and tried 62 common default usernames and passwords. CISA reported one attack drawing on about 380,000 infected devices.

Neither worm could infect a device it could not reach. WannaCry needed an open file-sharing port; Mirai needed a Telnet login reachable from the internet.

AI worms and self-replicating prompts

An AI worm spreads through AI assistants instead of through software flaws. In 2024, researchers Stav Cohen, Ron Bitton and Ben Nassi demonstrated Morris II, an adversarial self-replicating prompt. When a GenAI-powered email assistant read a message carrying it, the prompt triggered a cascade of indirect prompt injections: the assistant copied the prompt into its own output and into the data other assistants retrieved, and the next assistant did the same, with no user clicking anything.

This works because language models cannot reliably tell instructions from data. OWASP’s guidance on prompt injection says that, given how models work, it is unclear whether fool-proof prevention methods exist. The worm’s path is the assistant’s own reach: whatever content it reads, and whatever channels it can write to.

So the AI version keeps the same rule as the classic one. It spreads only as far as the systems it touches can send its payload.

Worm spread inside a local network

A worm can spread inside a local network if devices on it run something it can exploit. WannaCry was so damaging precisely because it scanned the local network after getting in. A flat office network where every laptop shares files with every other laptop is a good environment for a worm. Being local is not protection by itself; what matters is what each device exposes to its neighbours.

That points to the controls that stop spread inside a site:

  1. Run no services a neighbour does not need. A device with nothing listening has nothing for a scanner to find.
  2. Authenticate every peer. A device should talk only to peers that prove their identity with a key, not to anything that happens to be on the same network.
  3. Authorise every request. Proving identity is not permission. Each action should be checked against what that sender is allowed to do.
  4. Patch and segment. Keep devices up to date, and keep unrelated groups of devices on separate networks.
  5. Give AI assistants narrow reach. An assistant that reads untrusted content should not also be able to write to every channel and send data anywhere.

Narrow gateway as a worm airlock

One narrow gateway takes away a worm’s path between sites. A worm that wants to spread across a fleet has to reach each site, and from the internet there is only one thing to reach: the gateway. If the gateway opens no inbound services, carries only a defined set of messages under its own identity, and passes end-to-end encrypted content it does not interpret, a worm has no general-purpose door to walk through and nothing on the other side that answers a scan.

Think of the gateway as an airlock. Critical systems live on their own local networks and exchange a narrow, well-defined set of messages with the wider internet through one controlled link. An outbreak on the internet cannot scan its way in, and an outbreak that starts inside one site has no open route to the next. That is why a self-replicating worm cannot fully materialise across a fleet whose devices coordinate locally and reach the internet through one narrow gateway: the reachability it depends on is not there.

Worm containment with Offline Protocol

Offline Protocol has been built for this kind of fleet. Devices discover, verify and message each other over Bluetooth LE, Wi-Fi and local IP with no internet, and a local mesh needs no portal account or API key, so no device has to be reachable from the internet to do its job. Each device generates its own Ed25519 identity key and derives its address from it, and on a Wi-Fi peer stream a device is announced only under the address it proved. Messages and groups are end-to-end encrypted with MLS, so a relay or gateway carries frames it cannot read. When a site needs the wider network, it goes through a gateway provisioned against a defined contract, and a device that happens to have internet access does not automatically become a trusted upload destination.

The threat model is explicit about the remaining job inside a site. Residual risk R24 records that any device a mesh path reaches can ask another to build a session, bounded by forwarding allowances, budgets and caps, and the docs ask applications to authorise senders, validate schemas and bound payloads. That is the right division: the protocol removes the internet-scale paths and proves who every peer is, and the application decides what each peer may do.

Frequently asked questions

What is an AI worm?

An AI worm spreads through AI systems rather than through software flaws. The Morris II research showed an adversarial self-replicating prompt that, once read by a GenAI email assistant, made it copy the prompt into content other assistants then read, with no user clicking anything.

How did WannaCry spread?

CISA reported that WannaCry scanned IP ranges on the local network and connected over SMB ports, exploiting the SMBv1 flaw MS17-010 when port 445 answered. CISA's mitigations included patching and blocking SMB at the network boundary.

Does a firewall stop a worm?

It stops the worm from crossing the boundary on blocked ports, which is why CISA advised blocking SMB at the edge during WannaCry. It does not stop a worm already inside, so devices inside still need patching and should not run services they do not need.

Can a worm spread over Bluetooth?

Only to a device in radio range that runs something it can exploit. Range limits reach to devices physically nearby, and a protocol that authenticates every peer and encrypts every session leaves an unknown device little to talk to.

Is a local network the same as an air gap against worms?

No. An air gap has no automated connection at all, while a local network with a gateway has one narrow, automated link. That link is far smaller than an internet connection on every device, and it is the one place to filter and watch.

Sources

Build it with Offline Protocol

The security docs describe how Offline Protocol devices prove their identity, encrypt every session with MLS, and where the threat model asks your application to authorise requests.

Read the security model