Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285108 - net-mail/dovecot-1.2.4 problem with deliver binary permissions
Summary: net-mail/dovecot-1.2.4 problem with deliver binary permissions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Wolfram Schlich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-15 16:32 UTC by kiorky
Modified: 2009-09-18 14:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (dovecot.patch,2.07 KB, text/plain)
2009-09-15 16:40 UTC, kiorky
Details
Better patch to stick to the dovecot wiki according adding a special group. (dovecot.patch,2.35 KB, text/plain)
2009-09-15 18:26 UTC, kiorky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kiorky 2009-09-15 16:32:29 UTC
deliver need to have world permission removed!

Reproducible: Always

Steps to Reproduce:
1. emerge =net-mail/dovecot-1.2.4
2. configure dovecot to act as a LDA for any smtp


Actual Results:  
3. See that your mails are all bounced with:

Sep 15 18:30:17 pigeon postfix/pipe[17864]: 36C37A07B10B6: to=<kiorky@cryptelium.net>, relay=dovecot, delay=0.09, delays=0.03/0.01/0/0.05, dsn=5.3.5, status=bounced (local configuration error. Command output: /usr/libexec/dovecot/deliver must not be both world-executable and setuid-root. This allows root exploits. See http://wiki.dovecot.org/LDA#multipleuids )




Expected Results:  
mail delivered to mailbox

The fix is simple, remove the world permissions. (o-rwx)
Comment 1 kiorky 2009-09-15 16:40:27 UTC
Created attachment 204224 [details]
patch
Comment 2 kiorky 2009-09-15 18:26:14 UTC
Created attachment 204229 [details]
Better patch to stick to the dovecot wiki according adding a special group.


Dixit:
"You can do this by making sure only your MTA has execution access to it."

Thus, you can for example add something like this in your postfix configuration:
dovecot    unix    -       n       n       -       -       pipe
  flags=DRhu user=dovecot:mail
  argv=/usr/libexec/dovecot/deliver  -n -f ${sender} -d ${user}@${nexthop}
Comment 3 kiorky 2009-09-16 09:07:43 UTC
i forgot to say that this patch make deliver belongs to mail group.
With that manip', you can configure your applications to use some user which is in that group and thus gain the right to use deliver while the rest of the system may be secured.
Comment 4 Patrick Lauer gentoo-dev 2009-09-18 14:37:18 UTC
+  18 Sep 2009; Patrick Lauer <patrick@gentoo.org> dovecot-1.2.4.ebuild:
+  Improving suid behaviour, fixes #285108. Thanks to kiorky for the patch.