Closed eli-schwartz closed 4 years ago
It was based on least privilege principle, assuming no one needs to read these binaries. But you are right that there is no secret in there, and you mentioned valid reasons why read perms can be needed, so I think it would be fine to give read perms. Would you be happy proposing a PR?
Done.
I've heard arguments that when building the binary yourself, rather than downloading a byte-identical binary from a linux distribution repository, there is some security benefits from attackers not knowing the internal structure of the binary. But at least the owner should have rw permission. I'm not sure whether or how to extend that; which concern weighs heavier? can it be detected by the presence of non-null DESTDIR? etc. So for now, I have only implemented this w.r.t. the file's owner as I cannot think how this can backfire.
What's the point of this? There are no security secrets here, the software is open source and anyone can compile their own copy trivially. There is some rationale to avoid giving everyone execute permissions, but what on earth is wrong with read permissions? Especially, why is even the owner of the binaries prevented from reading the files without first running chmod?
This causes annoying error messages when trying to heuristically parse the binaries e.g. with readelf -d to see what shared libraries it depends on. It also prevents post-processing tools during distro packaging, from running commands such as
strip
(in combination withmake install STRIP=/bin/true
to avoid using the wrong strip commands) in order to store detached debugging symbols in /usr/lib/debug...
Program files should be readable by any user unless they contain e.g. cryptographic secret key material, and they should be writable by the user.