Although that does rely on targeting that specific attribute. There are probably a handful of ways to trigger an http request in this instance.
You don't actually even need to select that specific node - whilst you can't use :after on replaced elements, if the input has a sibling an attacker could input[type="password"] + div:after or something along those lines.
The main takeaway for me is that making a password field a controlled component is a marginal security risk in some instances, and letting people pump their own styles into sign-in pages is a bad idea.
I.e. <input type="password" style="background-image:none !important"/>