Mr Brown received the letter of warning from Mr Fennelly in March 2004.

PM warned of data risk

PM warned of data risk

The government was warned three years ago about the security flaws that led to the loss of 25 million people’s personal details, it has been reported.

The News of the World claims prime minister Gordon Brown was sent a letter three years ago – when he was chancellor – warning that junior staff had access to the child benefit database and that information was not being encrypted.

The fears were raised in a letter circulated by Treasury risk manager Richard Fennelly in March 2004 and obtained by the newspaper.

Mr Fennelly wrote: “Fraudulent/malicious activity was not being detected… Live support staff had root access and could do anything without being detected with obvious risks.”

He added there was “no encryption between certain elements in the system”.

The prime minister could face increased criticism in the wake of the leaking of the letter after it emerged a junior HM Revenue and Customs official (HMRC) has been blamed for losing the two discs containing the confidential details of 25 million child benefit claimants.

Shadow work and pensions secretary Chris Grayling told the newspaper: “This document blows apart Gordon Brown’s claims in Parliament that this was a one-off incident.

“Now we know that internal watchdogs in the government were warning three years ago that the child benefit database was at risk.

“Because no one took any action we now face a situation where millions of bank account details and information about all our children has been lost.”