Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28037 - (security) current QMail setup allows a kind of relaying
Summary: (security) current QMail setup allows a kind of relaying
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-06 03:27 UTC by Julien Cayzac
Modified: 2003-09-23 21:05 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Cayzac 2003-09-06 03:27:26 UTC
Gentoo's QMail package currently accept non-existent users. i.e, when connected
to a SMTP server which is running QMail on a Gentoo box, the following is not
rejected with an error 550:
RCPT TO:<non-existent-mail@mydomain.org>
Malicious users can set up the Return-Path: field of their mail enveloppe so
that when the MAILER-DAEMON bounces (because QMail finaly realizes no such user
exists, when it's too late) it spams a real e-mail address.


Reproducible: Always
Steps to Reproduce:
1. telnet somesmtpbox.domain.com 25
2. HELO spam.com
3. MAIL FROM:<poor.victim@otherdomain.com>
4. RCPT TO:<non-existent-user@somesmtpbox.domain.com
5. ...


Actual Results:  
The poor victim gets spammed, domain.com's mailbox is full of bounces which
failed in case the victim's e-mail address was wrong, and eventually
domain.com's admin can have some serious problems if the victims get bored.



The solution: applying the badrcptto patch. See http://patch.be/qmail/
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-06 14:53:23 UTC
The latest badrcptto patch is here:
http://sys.pro.br/files/badrcptto-morebadrcptto-accdias.diff.bz2
and should be in -r12 of qmail when I do the rediffing needed.

badrcptto is also not a proper solution to the problem.
as it would require you list each non-existent-user@somesmtpbox.domain.com in badrcptto.

Now you get a spammer trying random combinations for 'non-existent-user' and that file becomes huge.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-23 21:05:13 UTC
ok the patch is in -r12 now.

I also looked at the SMTP rfcs regarding your statement that error 550 should be returned for those cases.

The RFCs note that a 550 error code MAY be returned, but makes no requirement on this. 

The reasoning behind this is quite simple. While in the trivial case a mail server may known what accounts exist and do not exist, this does not hold true for a great many cases.

The overhead that is imposed on doing a user lookup before accepting the mail is quite unjustified in many cases, and in some cases, just impossible to implement.