Yahoo has fixed a vulnerability in its web mail service that, if exploited, could allow hackers access to users' mailboxes.