Why (blank) gets you root
objective-see.com
objective-see.com
Any existing but disabled account (an account with no shadow hash) will be upgraded to an account with a shadowhash. Normally this is fine, because it is an in-memory upgrade that allows the authentication code to run.
And then, because of a brain-dead if check, whatever password the user attempted to use is saved as the shadowhash for that account, permanently enabling the account with the password that was being tried. In this case, that means a blank password.
This allows a subsequent authentication with that same password to succeed. This accounts for the initial need to repeat the login multiple times.
The if statement seems designed to make sure that the password matches the currently stored password before doing anything, so the question is why does it not do that. Either the function returns that it does match for some reason or the return value is tested incorrectly. Currently the article doesn't say but maybe at some point the author will track that down :).
Then the question is why it happened, which would be easier to speculate on knowing what precisely is wrong.
Also a long time since I read the words "I put on my robe and wizard hat". LOL
That will worsen the impact even more, I'd say. Being able to enable disabled accounts my (locally or remotely) authenticating to a Mac system is very bad, even if those accounts are not root.
The vast majority of those usernames start with an underscore. Not sure if that matters. The trick didn't work for "daemon" and "nobody" either, though.
I think there has to be some special weirdness about how root is disabled on Macs. It's the only account with its own "Enable.." line in the Directory Utility menu, for example.
So at first blush this seems limited to root, but I'm not going to hold myself out as a macOS expert. Just someone with a Mac I don't mind trying to bork.
https://twitter.com/unsynchronized/status/935656609140711426
/usr/bin/osascript -e 'do shell script "<command to be run as root>" user name "root" password "" with administrator privileges'Imagine the even bigger fallout if the fix accidentally ended up locking everyone out of the machines, essentially losing all data on anyone with an encrypted drive.
Developers were discussing this weeks ago on the Apple developer forum...
They've now released an update.
As the blog post shows, the account creation is done on the first click, not the second. The second just logs you in.
A trivial test in this case would have been, try to log in with a non-existing account (or an account with the wrong password) and make sure no state has changed afterwards. No new users, no changed passwords, everything as it was. Unit testing 101.
Anyway, reader mode is your friend.
If we're to expect everybody to test the reflow of text on mobile devices, why can't we expect mobile users to put in a little elbow grease themselves when reading on a comically tiny device?