Security vendor Trend Micro has fallen victim to a widespread web attack that splashed malicious software on to hundreds of legitimate websites in recent days.

A Trend Micro spokesman confirmed that the company's site had been hacked, saying that the attack took place earlier in the week. "A portion of our site - some pages were attacked," said Mike Sweeny, a Trend Micro spokesman. "We took the pages down overnight Tuesday night - and took corrective action."

On Thursday security vendor McAfee reported that more than 20,000 Web pages have been affected by the attack. The pages are infected with malicious code that tries to install password-stealing software on the PCs of people who visit the sites.

Researchers are still not sure how the attackers are managing to hack these web pages, but the pages all seem to use Microsoft's Active Server Page (ASP) technology, which is used by many web development programs to create dynamic HTML pages. A software bug in any of those programs is all the attackers need to install their malicious code.

The infected Web pages are not obviously malicious, but the attackers have added a small bit of JavaScript code that redirects visitors' browsers to an invisible attack launched from servers based in China. This same technique was used a year ago, when attackers infected the websites of the Miami Dolphins and Dolphins Stadium just prior to the 2007 Super Bowl XLI football game.

The JavaScript attack code hosted on these infected Web sites takes advantage of bugs that have already been patched, so users whose software is up-to-date are not at risk. However, McAfee warns that some of the exploits are for obscure programs such as ActiveX controls for online games, which users may not think to patch.

It's embarrassing when security vendors fall victim to the attacks they are supposed to prevent, but Trend Micro is not the only company to have had its website hacked in recent months. In January, parts of CA's website were infected with a very similar type of attack.