Skip to content

qmail-pop3d: exit 1, pronto, if running as root. - #92

Merged
DerDakon merged 2 commits into
masterfrom
pop3d-nonroot
May 14, 2020
Merged

DerDakon merged 2 commits into
masterfrom
pop3d-nonroot

Conversation

@schmonz

@schmonz schmonz commented Aug 27, 2019

Copy link
Copy Markdown
Member

At least checkpassword-pam and DJB's original checkpassword are willing
to authenticate the root user and run a child program with UID 0. For
POP3 service -- the canonical checkpassword use case! -- this produces
runtime behavior that is inconsistent with...

  • qmail's design, because qmail-local will never run as root to populate
    a Maildir that qmail-pop3d could serve, and

  • qmail's security focus, because it lets abusers dictionary-attack the
    root password over the network.

Instead, in qmail-pop3d, if getuid() returns 0, we write to the logs and
exit 1. If someone manages to guess the root password, they won't know
they did: it looks exactly like any other failed checkpassword login.
And the sysadmin could potentially be alerted.

@schmonz schmonz added the bug Something isn't working label Aug 27, 2019
@schmonz schmonz added this to the 1.08 milestone Aug 27, 2019
@schmonz
schmonz force-pushed the pop3d-nonroot branch 2 times, most recently from a4cdce0 to 30e3225 Compare August 27, 2019 04:30

@DerDakon DerDakon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still would kill the whole thing and tell people to use dovecot or whatever, but until then this should be not totally insane.

@schmonz

schmonz commented Aug 28, 2019

Copy link
Copy Markdown
Member Author

I've added the idea to treat qmail-popup and qmail-pop3d as extensions for 1.9. (We don't know what that means yet, but it might be something like moving it out of this repo.)

Comment thread qmail-pop3d.c
Comment thread qmail-popup.c
@schmonz
schmonz force-pushed the pop3d-nonroot branch 2 times, most recently from 49f3471 to 5381af7 Compare September 2, 2019 15:50
@DerDakon
DerDakon requested a review from alanpost September 20, 2019 10:53
@DerDakon
DerDakon requested review from jlmuir, mbhangui and xenotrope May 14, 2020 14:27
Comment thread qmail-pop3d.c Outdated
At least checkpassword-pam and DJB's original checkpassword are willing
to authenticate the root user and run a child program with UID 0. For
POP3 service -- the canonical checkpassword use case! -- this produces
runtime behavior that is inconsistent with...

- qmail's design, because qmail-local will never run as root to populate
  a Maildir that qmail-pop3d could serve, and

- qmail's security focus, because it lets abusers dictionary-attack the
  root password over the network.

Instead, in qmail-pop3d, if getuid() returns 0, we write to the logs and
exit 1. If someone manages to guess the root password, they won't know
they did: it looks exactly like any other failed checkpassword login.
And the sysadmin could potentially be alerted.
@DerDakon DerDakon modified the milestones: 1.09, 1.08 May 14, 2020
@DerDakon
DerDakon merged commit 30a4440 into master May 14, 2020
@DerDakon
DerDakon deleted the pop3d-nonroot branch May 14, 2020 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants