Re: [BUG] Default search path used in require_resolvable_fromhost

[email protected] (Charlie Brady)
Newsgroups perl.qpsmtpd
Message-ID <[email protected]>
On Mon, 26 Jul 2010, Charlie Brady wrote:

> On Sun, 25 Jul 2010, Robert Spier wrote:
> 
> > I've committed this as ab7c2601f0740fac1c3c117e7e5c0a5690348194.
> > 
> > I'm not 100% sure it's a good idea, but I think it's mostly a good
> > thing.
> 
> What are your reservations?
> 
> I don't think it would ever be acceptable for the fromhost to be 
> resolvable only when the server's default domain is appended as suffix. 
> And as reported, the current code is exploitable, and Jesper claimed to 
> see it being exploited (but I am skeptical - is a spambot really injecting 
> mail to [email protected] direct to his server?).

There are multiple other uses of Net::DNS::Resolver, and some thought 
should be given to where some or all should also use dnsrch => 0 in the 
constructor.

[charlieb@localhost qpsmtpd-0.83]$ grep -r Net::DNS::Resolver .
./qpsmtpd-async:        $Net::DNS::Resolver::global{id} = 1;
./qpsmtpd-async:        $Net::DNS::Resolver::global{id} = int(rand(Net::DNS::Resolver::MAX_ID()));
./qpsmtpd-async:        # print "Next DNS ID: $Net::DNS::Resolver::global{id}\n";
./lib/Qpsmtpd/TcpServer.pm:  my $res = new Net::DNS::Resolver;
./plugins/require_resolvable_fromhost:  my $res = new Net::DNS::Resolver;
./plugins/require_resolvable_fromhost:  my $res   = new Net::DNS::Resolver;
./plugins/uribl:use Net::DNS::Resolver;
./plugins/uribl:    $self->{resolver} = new Net::DNS::Resolver or return undef;
./plugins/dns_whitelist_soft:  my $res = new Net::DNS::Resolver;
./plugins/dns_whitelist_soft:  my $res = new Net::DNS::Resolver;
./plugins/dnsbl:  my $res = new Net::DNS::Resolver;
./plugins/dnsbl:  my $res = new Net::DNS::Resolver;
./plugins/rhsbl:  my $res = new Net::DNS::Resolver;
./plugins/rhsbl:  my $res = new Net::DNS::Resolver;
[charlieb@localhost qpsmtpd-0.83]$ 



> 
> > Charlie - It would be great if you could send patches instead of
> > "suggestions".
> 
> It wasn't my suggestion - I was just relaying it. But point taken.
> 
> > -R
> > 
> > 
> > Charlie Brady wrote:
> > > 
> > > 
> > > http://bugs.contribs.org/show_bug.cgi?id=5808
> > > 
> > >  Jesper Knudsen      2010-03-01 01:29:10 MST 
> > > 
> > > When using the require_resolvable_fromhost plugin for qpsmtpd I noticed 
> > > that mails from [email protected] was actually getting through 
> > > this filter. I finally found out that the plugin has a bug that causes it 
> > > to insert default search path if it cannot find the domain. This means in 
> > > my case that localhost.localdomain was then tried resolved as 
> > > localhost.localdomain.swerts-knudsen.dk and since I have a wilcard CNAME 
> > > was resolved as my public IP.
> > > 
> > > Since this plugin is only enabled for public interface the fix is to set 
> > > the "dnsrch" flag when creating the Net::DNS object.
> > > 
> > > In require_resolvable_fromhost:
> > > my $res = Net::DNS::Resolver->new (
> > >                                    dnsrch => 0
> > >                                    );
> > 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.