The UK spy agency is working with phone networks to patch flaws that have left communication lines open to intrusion from hostile ­nation states.

The National Cyber Security Centre (NCSC), an arm of the Government Communication Headquarters (GCHQ), said it would work closely with companies such as BT and Vodafone to ensure that a flaw in the software used to service 4G networks will be patched in the coming months.

Paul Chichester, NCSC operations chief, said: "We assume that every piece of equipment in the telecoms networks has vulnerabilities.” Currently, mobile networks allow someone to connect using another person’s identity, intercept and even send messages on ­behalf of that user."

Attackers could spoof the location of a mobile device, make it look like they made a call at a different time and even force other devices to disconnect from a mobile network. This could be used to conduct fraud, by making texts and phone calls appear as if they are coming from a trusted source such as a bank, for example.