Keep in mind that a third party who has compromised the server could change the JavaScript to report password entries back to it.
This doesn't require compromising any servers, and a lot of laptops will configure their DNS settings based on what the local network's DHCP server sends them.
To the end user, it will appear as though nothing is wrong.