The Department of Justice has announced an indictment against seven government-sponsored Iranian nationals accused of internet-based attacks against the United States, including one who managed to gain control of a picturesque Westchester dam’s flood release controls.

The town of Rye Brook is small (a population of roughly 10,000), and its Bowman Avenue Dam is even smaller, at about 20 feet high. But according to the DOJ, Iranian hackers were on the verge of unleashing a flood that would have been, if not catastrophic, at least ugly and dangerous. The remote intrusion occurred in 2013 and was first reported by the Wall Street Journal two years later, but now the feds are confirming details of the hack:

Between August 28, 2013, and September 18, 2013, FIROOZI repeatedly obtained unauthorized access to the SCADA systems of the Bowman Dam, in Rye, New York, which allowed him to repeatedly obtain information regarding the status and operation of the dam, including information about the water levels and temperature, and the status of the sluice gate, which is responsible for controlling water levels and flow rates. Although that access would normally have permitted FIROOZI to remotely operate and manipulate the Bowman Dam’s sluice gate, unbeknownst to FIROOZI, the sluice gate had been manually disconnected for maintenance at the time his intrusion.

Had the sluice gate not been fortuitously “disconnected,” Rye Brook could’ve been flooded. More disturbingly is that the network-connected floodgate systems of the relatively tiny Bowman Dam aren’t fundamentally different from those of much larger dams with a much bigger potential for destruction if sabotaged.

If there’s any silver lining here, it’s that our national infrastructure is in many parts too shitty and dysfunctional to even hack; in a 2015 statement from the town of Rye Brook, it’s made clear that the sluice gate was never fully functional to begin with:

In or about June 2013, a sluice gate was added to the Dam, in order to help control the flow of water and assist with flood mitigation during storm events. The gate was designed to be opened and closed via computer; however, despite a ribbon cutting ceremony, the gate was never fully operational, and remained non-functioning through the DHS investigation. In any event, based on information provided to us, at no time was the sluice gate ever manipulated by unauthorized users outside of the City.

Emphasis added. The best cyber defense may not be a solid cyber offense, but governmental neglect.

You can read the indictment in full, below.