Lawyers defending the hacker accused of breaking into Sarah Palin’s Yahoo email account claim that his PC had been infected with spyware.

David Kernell, who is accused of hacking into the former Alaskan governor’s email account during the Republican presidential campaign of 2008 and will go on trial in April next year, is expected to claim that a malicious programme that had infected his laptop computer was responsible for the breach.

Lawyers of the 21-year-old student, who is the son of a Tennessee Democrat politician, will argue that he was not personally responsible for the attack on Mrs Palin’s personal email account, even though authorities traced the hack to an IP address used by Kernell.

Screenshots of the emails, including message content, were posted to Wikileaks and to the imageboard 4chan during the presidential campaign which Republican candidate John McCain, supported by Palin, lost to Barack Obama.

It was believed that hackers were able to break into the account by guessing Palin’s Yahoo password, a word that was thought to be easily associated with the 45-year-old based on information that was released into the public domain both before and during the election campaign.

This case would not be the first time that a successful defence citing a Trojan or other form of malware has been used. In perhaps the most high-profile case, jurors in UK acquitted 19-year-old Aaron Caffrey of hacking into and crashing computer systems at the port of Houston in Texas, believing his defence that hackers had broken into his computer and used it to launch the attack.

The defence has also been used in numerous cases surrounding the downloading and storing of obscene and unlawful materials, with computer forensics often demonstrating that the material was found on a PC due to malicious software that had infected the user’s PC rather than any deliberate user activity.

Like what you're reading? Subscribe to our top stories.

If you want to subscribe to our monthly newsletter, please submit the form below.