News for hackers. Stuff that matters.
Re:The Surreal Horror of Pam by Spivak on Tuesday November 09, 2021 @05:22PM (#29168318)
But that doesn't really answer the question. Nothing was really stopping a setuid program from granting access to the non-sensitive bits of the passwd/group files.
Re:The Surreal Horror of Pam by p_l on Tuesday November 09, 2021 @05:25PM (#29168347)
Efficiency (spawning setuid program for every line printed by ls -alv is a bit too much), and you don't want to make too privileged programs too (suid ls?)
Re:The Surreal Horror of Pam by Spivak on Tuesday November 09, 2021 @05:29PM (#29168398)
I mean the hypothetical program would have just dumped the whole file minus the sensitive bits.
Re:The Surreal Horror of Pam by mindwok on Tuesday November 09, 2021 @05:52PM (#29168640)
Exposing a setuid program that prints the file would be more dangerous though. The result is the same (you can read /etc/passwd) except now you have a vector for gaining root access through an exploit to this setuid program.
Re:The Surreal Horror of Pam by chungy on Tuesday November 09, 2021 @07:19PM (#29169439)
And then you've reinvented /etc/shadow but worse. :)
Re:The Surreal Horror of Pam by a-dub on Tuesday November 09, 2021 @06:31PM (#29168992)
see getpwnam, which was already public for years and linked by everything. it queries one record at a time.
Re:The Surreal Horror of Pam by tremon on Tuesday November 09, 2021 @09:37PM (#29170434)
getpwnam() gets its data by parsing /etc/{passwd,shadow}[0]. It isn't a magical system call that elevates the privileges of the calling program.

[0] assuming your nsswitch says so

Re:The Surreal Horror of Pam by a-dub on Wednesday November 10, 2021 @11:31AM (#29176586)
yeah. agree, was merely pointing out the public interface for querying passwd records for the purposes of highlighting why said interface might be another reason to reconsider the proposed idea of a setuid shim that reads a read protected /etc/passwd that contains password hashes and returns only the public components.
Re:The Surreal Horror of Pam by ectopod on Tuesday November 09, 2021 @06:11PM (#29168846)
...and nobody thought of dictionary attacks when it was designed.

So it was world readable.