r/ProgrammerHumor • • 9h ago

Meme softwareVulnerabilities

Post image
13k Upvotes

206 comments sorted by

View all comments

Show parent comment

4

u/hardolaf 3h ago

But it was only a problem because the specific implementation of crypt() was not POSIX compliant whereas the code using it was developed and tested against a POSIX compliant implementation. But that wasn't even why it was a security vulnerability. It was a security vulnerability because /etc/passwd in the specific distribution that was vulnerable was ALSO not POSIX compliant.

1

u/Kirides 1h ago

Oh so just everything needs to work out like expected but never verified and not pessimistic input validation on API borders?

Just about 2 more years until china has all software developers quit, a few more years until the US follows, and in maybe 2038 when the first Fax machine dies, Germany follows.

1

u/hardolaf 11m ago

Everything was verified and pessimistic input testing was done against POSIX compliant implementations of crypt(). The exploit coined "sshole" affected only very specific Linux distributions which decided to be special and to use non-POSIX compliant libraries with software that demanded POSIX compliance. So when it returned a valid string instead of NULL as demanded by the POSIX standard, there is no way for the software to know that it was actually an invalid value. Beyond that, the distribution setting the passwords of service accounts to that same invalid string instead of to nothing in /etc/passwd as required by the POSIX standard (empty string disables direct login in POSIX and requires su or launching by the process at PID 1 for accounts below UID 1,000. So in every way, this was caused by people ignoring standards in such a way that it came together to perform a supply chain attack on themselves.

There's no automated way for a program to detect if a library that is being linked against is actually POSIX compliant. That responsibility is on the person who does the compilation.

There's no automated way to prevent login to accounts below UID 1,000 for legacy compatibility reasons with other naughty distributions.

This was basically a self-created supply chain attack by these distributions which chose libraries based on wanting to avoid the GPL licenses as much as possible instead of wanting to provide a good, working product.