Boris Johnson’s adviser Dominic Cummings would have challenged the EU referendum result as “invalid” had Vote Leave lost the Brexit campaign.

According to documents seen by the Observer, the prime minister’s chief aide told the UK’s data watchdog that he would have contested the result because UK elections are “wide open to abuse.”

In an email sent in 2017 to the information commissioner’s office, Cummings, the former head of the Vote Leave campaign and architect of Johnson’s stunning election victory, said: “If we had lost by a small margin I would have sought to challenge the result as invalid.”

The UK voted to leave the EU by the slim majority of 52% to 48% in the 2016 referendum, with many Brexiters subsequently attacking the losers as “Remoaners” who refused to respect democracy. On Friday, Cummings openly criticised “educated Remainer campaigner types” for failing to understand the country and “driving everyone mad”.

The correspondence was sent by Cummings on 16 July 2017 to Steve Wood, deputy information commissioner, along with several officials from Vote Leave, whose high-profile supporters included Johnson and cabinet minister Michael Gove.

It was sent in response to queries from the Information Commissioner’s Office (ICO) which at the time was investigating concerns over the use of “data analytics” in political campaigns. The watchdog subsequently unearthed a “disturbing disregard for voters’ personal privacy” and castigated data firms, social media and political parties.

The emails suggest that the reason Cummings would have challenged the result of the EU referendum and other polls if he had been defeated was because “the entire regulatory structure around national elections including data is really bad” and “wide open to abuse”. He cited allegations that individuals who claimed to have voted illegally in the 2016 EU referendum were seemingly ignored by the elections watchdog.

Boris Johnson at the launch of the Vote Leave bus campaign in May 2016. Photograph: Darren Staples/Reuters

“The Electoral Commission took no action in response to widespread public claims by people on social media that they had voted illegally to stay in,” the correspondence said.

The emails added: “There has been no proper audit by anybody of how the rules could be exploited by an internal or foreign force to swing close elections.”

Downing Street was recently accused of wilfully ignoring evidence of Kremlin interference in the 2016 referendum by refusing to publish an intelligence committee report into Russian infiltration of British politics ahead of the election.

The emails were acquired by the parliamentary inquiry into disinformation and democracy after the Electoral Commission was compelled to hand over correspondence to MPs.

Ian Lucas, a former member of the Department for Digital, Culture, Media & Sport committee (DCMS) which investigated the influence of fake news, said it was vital the correspondence was made public. “I thought it was crucial that the public saw this correspondence. I used every means possible to secure the publication of them by parliament but ultimately was blocked from doing so, so I have chosen to make them public myself,” said the former MP for Wrexham, who stood down before the election.

The development follows a move by the data rights campaigners Open Rights Group, which last week threatened legal action against the three major parties’ use of personal data ahead of the election.

The Electoral Commission found Vote Leave committed multiple offences under UK electoral law and has referred the matter to the Metropolitan Police. Last month Scotland Yard passed a file to the Crown Prosecution Service and said it was seeking advice on its investigation into the official Brexit campaign.

The campaign group was also fined £61,000 last year after the commission found it had exceeded its £7m spending limit for the vote. Vote Leave said at the time its findings were “wholly inaccurate”.