Homeland Security’s agency that deals with cyber threats said that the hack “poses a grave risk to the federal and local government as well as critical infrastructure.”