For some unlucky spiders, the zombie apocalypse is now. Some parasitic wasp larvae can take over their minds, forcing them to weave special webs the wasps use to support and protect their cocoons. A new study shows that the webs these particular zombie spiders weave are reinforced versions of the ones they normally use while molting, suggesting the wasps may be hijacking this pathway in the spiders’ brains.

The horror begins when a parasitic wasp dive-bombs a spider and stings it, causing temporary paralysis. The wasp then injects the spider with an egg or glues it to the spider’s abdomen and flies off. After a few weeks, the egg hatches into a larva and starts to grow by making small holes in the spider’s abdomen and sucking its blood. When it reaches the last stage of its development, the larva somehow induces the spider to spin a web on which it builds its cocoon—but not until it has killed the spider and sucked it dry.

For decades, researchers have wondered how the wasp larva gets the spider to do its bidding. At first, they thought that the wasp debilitated the arachnid by sucking so much of its blood, causing it to build a strange web that happened to serve as a good platform for the cocoon. Recent studies, however, have suggested that a more sophisticated type of mind control is going on.

To find out how it might be happening, researchers surveyed more than 1600 spiders (Cyclosa argenteoalba) near the cities of Tamba and Sasayama in south-central Japan. They found parasitic wasp larvae (Reclinervellus nielseni) on 23 of the silver-white spiders. The scientists brought them back to the lab and recorded videos of them spinning their special cocoon webs. They then compared the zombie spiders’ behavior with that of normal arachnids.

C. argenteoalba spiders normally build two types of webs: circular, sticky orb webs that help them catch flies and other prey; and a stripped-down, nonsticky version called a resting web. These webs are like hammocks that the spiders use when they molt. The team found that of the 11 larvae that reached the pupal stage, 10 caused their host spiders to spin cocoon webs that appeared to be modifications of their resting webs. This suggests that the wasp larvae were subtly altering the web-building programming of the arachnids themselves, the team reports in the current issue of The Journal of Experimental Biology.

What’s more, the team found that the cocoon web threads were much stronger than either of the other two webs. That makes sense, says co-author Keizo Takasuka, because spiders molt for only a few days and may not need the extra reinforcement. The wasp larva, however, develops in its cocoon for more than 10 days, an extended period of vulnerability to the elements and predators that a stronger web seems likely to protect.

The study “fills in the details” of what’s going on between the wasp larvae and their spider hosts, says William Eberhard, an evolutionary biologist at the Smithsonian Tropical Research Institute and the University of Costa Rica who has studied this parasitism in the past. Still, he says, the big question that remains is how exactly the wasps turn the spiders into zombies in the first place. He suspects—in line with the researchers—the larvae inject molting chemicals into the spiders’ abdomens, where they are carried to the brain and nervous system and “flip certain switches.”

“All of those mechanisms are still a mystery,” Eberhard says. “That’s probably the most intriguing part of the story.”