A pile of Bitcoin slugs sit in a box ready to be minted on April 26, 2013 in Sandy, Utah. George Frey/Getty Images/AFP/File As many as two million European users of Yahoo may have received PC malware from virus-laden ads served by its homepage over a four-day period last week.

Some of the malware would turn PCs into bitcoin miners - a huge drain on its computing resources - without users' knowledge. Yahoo has been criticized for not saying how many people could be affected or doing anything to help those with the malware, which attacked flaws in Java modules on systems.

In a statement, Yahoo said: "From December 31 to January 3 on our European sites, we served some advertisements that did not meet our editorial guidelines – specifically, they spread malware." Users in North America, Asia Pacific and Latin America weren't affected, Yahoo said. Nor were users of Apple Macs or mobile devices.

"We will continue to monitor and block any advertisements being used for this activity," the company added. "We will post more information for our users shortly."

According to Light Cyber, a security research firm which warned Yahoo of the attacks in late December, one of the malware programs delivered in the attack turned the victim's computer into a bitcoin miner. The computer is set to work performing the calculations required to make the bitcoin network run, but the rewards for doing so accrue to the malware writer.

Yahoo has been criticised for not doing more to aid users infected by the faulty adverts. Dan Farber of technology site CNET says that: "At this point, Yahoo hasn't addressed any of the details, such as how the malware exploit got into its Web pages, how many users are impacted, and what victims of the attack should do. The company may still be gathering data."

Fox IT, the Dutch cybersecurity firm which first disclosed the vulnerability to the public, estimated that there were around 27,000 infections every hour the malware was live on the site. If the malware was being served consistently for the three days, it may be the case that almost 2 million computers were infected.

Java target

"The attack focused on outdated software," says Steve Regan of security site CSO. "The only way for the exploits to work is to have outdated versions of Java on your system. If Java is up to date, then the odds are, you're safe. However, I don't trust Java, so unless you absolutely need it, my advice is to uninstall it from your system. It seems like I see more zero-day attacks aimed at Java than anything else, the risk isn't worth it for me." Zero-day attacks exploit previously unreported flaws in software to install malware or take over a computer.

As well as the bitcoin mining malware, other software installed includes ZeuS, which attempts to steal banking information; Andromeda, which turns the computer into part of a "botnet" for use by third parties, and "adjacking" malware which hijacks the user's browser to click on adverts, thus channeling income to corrupt site owners.

Bitcoin is fast becoming a tool of choice for malware developers. As well as directly using compromised computers to mine for new coins, software such as ZeuS lets criminals install Cryptolocker, a dangerous new type of malware which first encrypts the user's files and then demands a ransom, payable in bitcoin, to decrypt them. In most versions of Cryptolocker, the ransom is set at two bitcoins, currently worth around $2,000.

Bitcoin is so valuable to botnet owners, criminals who control large numbers of compromised computers, that one academic paper argues that the security of the network is permanently at risk. Philipp Güring and Ian Grigg argue that the currency violates Gresham's Law (pdf), an economic theorem that states that bad money drives out good. Since bitcoin mining is far more profitable done on stolen computers with stolen energy, they argue, it will soon be uneconomical to do it any other way.

• Marissa Mayer aims to revive Yahoo with shift 'from complexity to clarity'

This article originally appeared on guardian.co.uk