A cleaner New York Harbor has been a boon to boaters, fishermen, and waterfront-goers of all stripes. Unfortunately, it's also made life easier for rapacious and destructive creatures that have tormented New York from time immemorial. The harbor's detox has revived marine borers, tiny but persistent pests that dine on wood and have a particular taste for the load-bearing timber piles that fortify the city's shoreline. Left unchecked, they pose an existential threat to structures supported by piles.

Large swaths of beloved Brooklyn Bridge Park sit on piers in the harbor. Marine borers are gnawing at the park's Achilles Heel.

So what, exactly, are we up against?

Two species of marine borer make their homes in New York Harbor. The first is the delightfully named gribble (Limnoria quadripunctata), a diminutive crustacean that resembles a miniature shrimp. Gribbles attack wood from the outside, turning a sturdy pile into the timber equivalent of swiss cheese.

The other local borer is the shipworm (Teredo navalis). Shipworms are round and thin and can grow as long as a foot. Despite its name, the shipworm is not a worm, but rather a mollusk, cousin to the happy clam. Unlike gribbles, shipworms eat wood from the inside out.

For this reason, shipworms are particularly insidious, as the structural damage they inflict is not visible. And once a shipworm has burrowed into its habitat, it is there for life.

"As long as they have wood, they will continue to grow," says Daniel Distel, a research professor at the Marine Science Center at Northeastern University.

This shipworm could cost Brooklyn Bridge Park $300 million over the next 50 years.

Shipworm fossil specimens date back 60 million years. They're not native to these parts—like most New Yorkers, their ancestors were immigrants. In his book Gotham Unbound, historian Ted Steinberg theorizes that at some point along the line, shipworms "hitched a ride in a ship sailing for New York." By the early decades of the 19th century, they were a known nuisance. Steinberg dug up a City Council document from 1833 stating that the city's piers "generally endure only from 14 to 17 years before they are destroyed by worms."

During the construction of the Brooklyn Bridge, engineers took great care to guard against the shipworm. An 1869 article in the Brooklyn Daily Eagle explains how the timber piles supporting the bridge's enormous feet were to be sunk deep into the mud riverbed, where the shipworm (the Eagle calls it the teredo) could not go. The article goes on to describe the shipworm's destructive power, how elsewhere, certain piles above the mudline were inspected that in eight years had been "perforated in every direction by the teredo, or worm, so as to be absolutely honeycombed and destroyed, and become mere shells."

Gribble in wood.

To protect them from borers, the beams of the wood caissons used in the excavation for the bridge were clad in a heavy armor: a mixture of coal tar, rosin and hydraulic cement, covered with tar paper, heavy tin soldered air tight, more tar paper, and finally thick yellow pine sheeting treated with creosote.

In the late 19th century, the city started to develop a remedy for the shipworm: dumping enormous volumes of toxic waste into its waters. In 1889, the Eagle reported that the shipworm had not been seen in Wallabout Bay or the Navy Yard waterfront in years. The paper speculated about the cause of this sea change:

The cause of its non appearance where at one time it was active is not known, but it is surmised that the large discharge into the Wallabout Bay of foul matters from sewers, sugar refineries and oil distilleries may have something to do with it.

The salutary effects of terrible water pollution was noted for decades, as the creature mostly disappeared from New York. In 1948, the Port Authority happily found that proposed sewage treatment plants would continue to keep the city's inner harbor free of marine borers for at least 20 years.

That all changed with the passage of the Clean Water Act in 1972. By 1987, the city was treating 100 percent of its dry-weather wastewater flows. Meanwhile, the EPA forced major polluters, most notably General Electric, to stop dumping PCBs into the Hudson River and to clean up some of the mess they'd made.

Cleaner waters brought fish, oysters and whales back to New York City. Marine borers also returned, where they found cleaner waters abundant with delectable timber piles.

The resurgence went mostly unnoticed until December of 1995, when a 70-foot section section of wharf on the East River near 14th Street collapsed, its supports apparently chewed into submission. Divers investigating the collapse discovered about a dozen piles in the area with structural damage caused by marine borers. New York City was on alert: marine borers were back to feast on the very foundations of the city's shoreline.

Dealing with borers is annoying. It's also expensive. David Lowin, who serves as vice president for real estate for the Brooklyn Bridge Park Corporation, said the cost of repairing and retrofitting the park's piers to be marine borer resilient will add hundreds of millions of dollars in additional operating costs over the next half century. (To put that in perspective, the original cost to construct the park, according to Lowin, was $400 million.)

"We knew that because we had timber piles and because the water had gotten cleaner, we were going to have to undertake a program of encapsulating them," says Lowin.

Timber piles in Brooklyn Bridge Park (Tom Hynes)

Several options for protecting the piles have been explored. In the '80s, when the Port Authority owned the piers, it experimented with wrapping the piles in dark plastic sheaths, the remains of which you can still see near Pier 1. This approach was abandoned when it was discovered that the plastic sheaths transform the piles into breeding grounds for bacteria and fungi, causing the wood to decay. So that's out.

One approach is to encase the piles in structural concrete as they deteriorate. This approach would spread out the cost of maintenance, but would run the estimated bill up to $335 million over five decades, and that's with optimistic projections about the cost of construction.

The third, and Lowin's preferred option, is coating piles with a protective epoxy coat. This would involve a huge upfront cost, in the realm of $100 million, but would save the park about $90 million in the long run.

"We believe the preventative maintenance of coating them in epoxy before they get damaged in the first place is the right way to go for a lot of reasons," Lowin said. "It's more environmentally efficient, and it allows us to do those repairs without shutting down sections of the park."

Or we could just fill the harbor with sewage again.

Thomas Hynes writes on New York City wildlife. He lives in Brooklyn Heights with his wife and their dog.