Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#36687 - [filesystem] /var/spool/mail directory is set to world writable by default
Attached to Project:
Arch Linux
Opened by Aaron Lancaster (martian67) - Tuesday, 27 August 2013, 07:41 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 25 October 2014, 16:59 GMT
Opened by Aaron Lancaster (martian67) - Tuesday, 27 August 2013, 07:41 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 25 October 2014, 16:59 GMT
|
DetailsDescription: the /var/spool/mail directory is set to world writable by default, it should be set to the permissions of the mailer/root by default. This is a security issue because you could create an mbox for a user and then intercept mail if it does not already exist.
Additional info: * package version filesystem 2013.05-2 Steps to reproduce: n/a |
This task depends upon
Closed by Dave Reisner (falconindy)
Saturday, 25 October 2014, 16:59 GMT
Reason for closing: Not a bug
Additional comments about closing: mode 1777 is intentional, and not insecure for this directory.
Saturday, 25 October 2014, 16:59 GMT
Reason for closing: Not a bug
Additional comments about closing: mode 1777 is intentional, and not insecure for this directory.
create a new regular user
as a second unprivileged user execute: touch /var/spool/mail/newusername
chmod 666 /var/spool/mail/newusername
send mail to the new user
the second unprivileged user can now read the mail of the newuser
this is a problem with at least opensmtpd, have not tested other mailers.
issue can be resolved by setting permissions on the /var/spool/mail to 755, MTAs will have the correct permissions to properly create mbox files.
referenced filesystem PKGBUILD code:
https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/filesystem#n63
attached a fix
There is no security issue (the above attack will not work) because in this case all local mailboxes are forced to have permissions 600, otherwise delivery does not occur. And yes, by default exim relies on the sticky bit because it runs with local (target) unprivileged user permissions and needs to put a lockfile in /var/spool/mail.
I don't know about postfix, but it should be similar, or at least configurable. Unless I missing something, I suggest closing this...