Pam 1.5.0 has a auth bypass under some conditions
openwall.com
openwall.com
[0] https://github.com/linux-pam/linux-pam/commit/dd9cf929e7ec79...
Unfortunately it should be noted on most distributions this will cause counterintuitive breakages -- most notably ping won't work for unprivileged users (but luckily you can fix this by changing net.ipv4.ping_group_range to include the unprivileged user groups -- I hope distributions fix this eventually...).
[1]: https://github.com/linux-pam/linux-pam/commit/af0faf666c5008...
Searching around, the best I can find is one 0.1 crate that hasn't seen activity since 2017:
It's saying something that rolling-your-own is even a debatable alternative to PAM (because if there's a flaw in your program, "only" that program is vulnerable, not the whole system. "Only" in quotes because it's just one privilege escalation step away)
Before you come up with an answer involving /etc/shadow and crypt(), consider that not all systems use local password files... and that you've just reinvented what PAM does, except less flexible and more prone to implementation errors.
Ssh certificates certainly "reinvent" auth - but not really in a bad way. Kerberos should also be quite possible without Pam.
But either way, you need some trusted code with privileges to grant privileges (eg an suid binary).
The other BSDs and macOS use OpenPAM [2] instead of Linux PAM. Both are written in C.
[1] https://alien.slackbook.org/blog/slackware-introduces-pam-in...