Hackers compromised firewall devices within the US federal government, according to a senior federal official.