Malicious ads served through Yahoo’s ad network delivered malware to thousands of site visitors, according to researchers at Fox-IT, but Yahoo subsequently blocked the attack.

Fox-IT’s post said that visitors who saw the ads in their browsers were redirected to a “Magnitude” exploit kit. “This exploit kit exploits vulnerabilities in Java and installs a host of different malware,” Fox-IT said, including ZeuS, Andromeda, Dorkbot/Ngrbot, ad-clicking malware,Tinba/Zusy and Necurs. The security company’s investigation dated the start of the infection to December 30 but it said it might have begun earlier.

Yahoo confirmed the infection and said it had taken action to remove it. “At Yahoo, we take the safety and privacy of our users seriously. We recently identified an ad designed to spread malware to some of our users. We immediately removed it and will continue to monitor and block any ads being used for this activity,” a spokeswoman said via email on Saturday.

Using a sample of traffic and a typical infection rate of 9 percent, Fox-IT said that the malware infected about 27,000 clients every hour. The countries whose users were most affected were Romania, the U.K. and France, according to Fox-IT.