The WannaCry cyberattack which hit 200,000 computers across the world was the result of a "huge screw-up" by the U.S. government as a result of its spying practices, Wikipedia founder Jimmy Wales told CNBC on Friday.
Last week, a virus known as WannaCry exploited a security flaw in Microsoft's (NASDAQ: MSFT) Windows XP operating system. The vulnerability was originally discovered by the National Security Agency (NSA) to spy on users. While Microsoft had released a fix for the bug in March, many users had not updated their software.
When the bug was leaked online in April, the hackers were able to see the flaw to launch the WannaCry attack which locked users' files on their computer and demanded they pay a ransom in the cryptocurrency bitcoin to get it back.
On Sunday, Microsoft's Chief Legal Officer Brad Smith criticized the U.S. government and said the cyberattack shows the dangers of spy agencies "stockpiling" these security vulnerabilities like they would weapons. Wales backed Smith.
"I would join with Microsoft and the other leaders of the industry in saying this is a huge screw-up by the government," Wales told CNBC.
"This is an issue that should have been, the moment the NSA found it, they should have notified Microsoft so they could quietly issue a patch and really chivvy people along long before it became a huge problem. So I think it's very problematic when we see the security services stockpiling and weaponizing what are things that are very risky to the public."
Wales compared it to a stash of Tomahawk missiles that have been stolen and then deployed.
"That's not OK," he added.
More From CNBC