Yahoo has moved quickly to squash a bug that could have seen an attacker gain root access to its servers.