An Ontario transit agency says it was in the crosshairs of a North Korean cyberattack earlier this month.

The attack was a virus, routed through Russia, that infected computers at Metrolinx, according to a source at the agency who spoke on condition of anonymity.

Spokesperson Anne Marie Aikins confirmed to CBC Toronto that the attack took place, but said it did not result in any breach in privacy and did not compromise any safety systems.

Aikins could not provide further details about the attack, citing "security reasons."

Metrolinx is an arm's-length organization in charge of transportation for the Toronto and Hamilton area.

Implicated in recent hacks

North Korea has been implicated in recent hacks, including the WannaCry ransomware attack that infected hundreds of thousands of computers worldwide and crippled parts of Britain's National Health Service in May.

U.S. Homeland security adviser Tom Bossert wrote in a Wall Street Journal op-ed last month that North Korea was "directly responsible" for the WannaCry ransomware attack and that Pyongyang would be held accountable for it.

Bossert said the U.S. administration's finding of responsibility is based on evidence and confirmed by other governments and private companies, including the U.K. and Microsoft.

American officials have also said that North Korea is responsible for the Sony cyberattack in 2014 that dumped personal information of tens of thousands of current and former workers online.

North Korea has denied involvement in both cases.