“We won’t talk more, all we know is MONEY! Hurry up!”

This was the ransom note that confronted Baltimore officials on 7 May when hackers crippled government computers with a virus, taking the systems hostage. The ongoing cyber-attack has halted real estate transactions and shut down websites for processing water bills and other services.

The horrors of ransomware – where cybercriminals break in, lock up computer data, then demand payments to restore access – have increasingly hobbled cities and municipalities across the globe in recent years. The crisis in Baltimore, where officials have refused to pay the $76,000 bitcoin ransom, follows similar incidents in Atlanta, Newark, San Diego and Los Angeles.

What terrifies me is if it happens on a large scale Jeff Kosseff, cybersecurity expert of US Naval Academy

These cyber intrusions are expected to continue disrupting ill-prepared local governments and public services, with devastating financial impacts and potentially life-threatening consequences, experts warned. Any agency that depends on digitized records could be at risk, including emergency services, water utilities and other infrastructure, healthcare services, voting systems and public education.

“We have an exponentially increasing problem,” said Katie Moussouris, founder and CEO of Luta Security, which helps businesses and governments work with hackers to identify vulnerabilities. “We don’t have an exponentially increasing workforce. If we don’t see cities and towns … start pouring a bunch of resources into hiring more people, we are going to see it happening over and over again.”

A sign referring to the hacked computer system of Baltimore is taped to a door near Baltimore city hall in Baltimore, Maryland. Photograph: Stephanie Keith/Reuters

Stolen National Security Agency tool

The mess in Baltimore has attracted particularly intense international scrutiny following a New York Times report suggesting the cybercriminals used a malware component that originated with the National Security Agency (NSA). The NSA allegedly lost control of the tool, called EternalBlue, in 2017, enabling hackers to paralyze vulnerable towns and cities across the country.

Security experts hope Baltimore’s ongoing crisis motivates municipalities to take these threats seriously. Baltimore leaders have estimated that the attack could cost at least $18.2m, from lost and delayed revenue and costs to restore infected systems.

The mayor, Bernard “Jack” Young, has said the city would not pay the ransom, though at one point, he hinted he was was considering paying it to “move the city forward”.

Baltimore’s mayor, Bernard ‘Jack’ Young. Photograph: José Luis Magaña/AP

City agencies are especially ripe targets because they often maintain databases of vital and sensitive information while having constrained information security budgets and inadequate technological safeguards.

“Municipal governments and hospitals … just don’t have the top cybersecurity out there, and the criminals know this,” said Jeff Kosseff, assistant professor of cybersecurity law at the US Naval Academy. “You can see loss of life happening if the hospitals are not able to function … What terrifies me is if it happens on a large scale.”

Disruptions to the functioning of ambulances, rescue squads, fire stations, waste collection and other services could all have serious human consequences, he said.

When a massive cyber-attack hit the state of Colorado last year, the first step was to shut down 2,000 infected government workstations. The next task was more complicated: figure out if people’s lives were in danger.

“That day one was brutal,” said Deborah Blyth, Colorado’s chief information security officer, recounting the ransomware that afflicted the state transportation department and quickly sparked fears of harmful disruptions to traffic operations: “Right away, it was impossible to even understand the scope.”

The Hollywood Presbyterian medical center in Los Angeles, California, was targeted in a cyber-attack in 2016 and paid out $17,000. Photograph: Mario Anzuoni/Reuters

‘Some victims decide paying out is cheapest option’

In the coming years, cybercriminals will just repeat their attempts across governments until they find one that is vulnerable, said Tyler Moore, a University of Tulsa cybersecurity professor. “Attackers have found a playbook that is working.”

It’s a playbook that remains profitable.

That’s because some victims choose to pay, despite ethical concerns about capitulating to ransom demands and despite the fact that there’s no guarantee of restored access. In some cases, paying bitcoins may be a cheaper and quicker resolution. One report suggested that cyber-attackers have collected millions in ransom in recent years.

Even if major cities view Baltimore as a wake-up call and adopt reforms, “It wouldn’t shock me to see smaller cities roll the dice,” said Hannah Quay-de la Vallee, senior technologist with the Center for Democracy and Technology. She said she was also concerned about educational institutions that have major budget challenges and systems with crucial personal data, such as students’ medical information and allergies and individual special needs plans.

The frustrating reality for information security leaders is that the technical solutions are known and easy to implement, if there is funding: cities have to update their systems with available security patches and maintain effective data backups. Without patches, hackers can break in and demand money, and if officials don’t have the data stored elsewhere, they have to choose between paying ransom or rebuilding systems.

“Those who are unwilling to pay the price to upgrade systems and people … are going to pay the price one way or the other,” said Alan R Shark, executive director of Public Technology Institute, which provides consulting services to governments.

Baltimore made the right decision refusing to pay, but the crisis could drag on for months as a result, said Avi Rubin, a Johns Hopkins computer science professor. “They don’t have a lot of the data … They are going to face a real challenge building up all the systems organically from scratch.”

In the Colorado attack, the malware hit the transportation department’s business services, but ultimately did not spread to road and traffic operations. Thousands of workers were, however, forced offline, which meant the state had to communicate with employees by leaving printed handouts on their desks and scheduling conference calls, said Blyth.

The state eventually brought in the national guard to help.

Colorado has since adopted a range of new practices to prevent future attacks, said Blyth, adding that officials have thought through worst-case scenarios: disruptions to healthcare, prisons, emergency communications, traffic safety, fire departments.

“What if it was a broader impact – affecting multiple of those services at once?” she added.

Despite the challenges, Blyth remained confident that refusing the attackers’ demands was the right call. “We would not even think about paying the ransom. We didn’t want to contribute to what we knew was criminal behavior.”

Follow Guardian Cities on Twitter, Facebook and Instagram to join the discussion, catch up on our best stories or sign up for our weekly newsletter