Samsung Electronics is investigating allegations that some models of its R Series laptops contain keylogging software that could be used to record anything typed on the laptop computers.

Mohamed Hassan said he became aware of the issue last month, when he purchased a Samsung R525 at a Best Buy in Toronto. The laptop had keylogging software on it, which he deleted immediately. Two weeks later, Hassan decided he wanted a more powerful machine, so he returned the R525 and bought a new model -- the R540, at a local FutureShop. To his surprise, the keylogger was there too, Hassan said in an interview Wednesday.

"These were new systems. They weren't used for anything," he said. "I could give them the benefit of the doubt on the first one. But then when I got a second model, a different model from a different store, that tells me that Samsung is aware of the problem."

Hassan, an IT consultant based in Toronto, said that Samsung tech support told him: "We just put it there to find out how the computer is being used."

Samsung spokesman Jason Redmond said that his company is looking into Hassan's allegations. "We take these claims very, very seriously," he said. He had not previously heard of the problem, or heard of de Willebois Consulting, the company that makes the StarLogger software that Hassan said he found on the laptop. "We have no understanding of a relationship with this company and we have no prior knowledge of this software being on our laptops," he said.

De Willebois Consulting did not respond to messages seeking comment for this story. On its website, the company says StarLogger "is completely undetectable and starts up whenever your computer starts up. See everything being typed: emails, messages, documents, web pages, usernames, passwords, and more." The software can also capture screen images, the website says.

If Samsung is responsible for putting the keylogger on the machines, Samsung could be in big trouble, according to Cindy Cohn, legal director for the Electronic Frontier Foundation. "They shouldn't be installing keyloggers on devices that they're selling to the general public. Even if Samsung isn't using it, you're basically setting up someone else to use it," she said.

As with Sony BMG's notorious rootkit software, discovered in 2005, if Samsung secretly installed keyloggers on customers' computers, it could lead to civil lawsuits or charges that the company is violating state consumer protection laws. "There are serious criminal offenses possible if they're actually using this device to spy on their customers, but I don't see any evidence of that," Cohn said. "This could be chalked up to poor thinking, or it could be illegal. We just need more information to be able to figure out where it is on this scale."

Keyloggers are commonly used by hackers to steal sensitive information including usernames and passwords from hacked computers, but de Willebois' website describes some legitimate uses for its software: monitoring children's Internet activity or recovering text in the event of a computer crash, for example.

IDG, the parent company of the IDG News Service, also publishes Network World.

Robert McMillan covers computer security and general technology breaking news for The IDG News Service. Follow Robert on Twitter at @bobmcmillan. Robert's e-mail address is robert_mcmillan@idg.com