dos with bad srv record
Martin Atkins
mart at degeneration.co.uk
Wed Dec 17 21:46:46 UTC 2008
Domrachev Ivan wrote:
> if srv record is bad formed then djabberd crashes. debug logs:
> ---
> 33 DEBUG DJabberd.Connection.ServerIn Got a dialback result, orig: first.tester.com, recv: conference.second.tester.com
> 833 DEBUG DJabberd.DNS pkt = Net::DNS::Packet=HASH(0x1190a78)
> 833 DEBUG DJabberd.DNS sock = IO::Socket::INET=GLOB(0x1842668)
> 833 DEBUG DJabberd.DNS DNS socket IO::Socket::INET=GLOB(0x1842668) became readable for 'srv'
> 833 DEBUG DJabberd.DNS DNS socket IO::Socket::INET=GLOB(0x1842668) for 'srv' found stuff, now doing hostname look
> up on 192.168.0.216.tester.com
> 833 DEBUG DJabberd.DNS Skipping lookup for '192.168.0.216.tester.com', it is already the IP
> 833 DEBUG DJabberd.Connection.DialbackVerify Attempting to connect to '192.168.0.216.tester.com'
> Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/local/lib/perl5/5.8.8/mach/Socket.pm line 373.
> ---
> srv record looks like:
> _xmpp-server._tcp.conference.first.tester.com 192.168.0.216.tester.com.
>
>
>
Thanks for reporting it. Sorry it took so long for anyone to reply.
I checked in a fix:
http://code.sixapart.com/trac/djabberd/changeset/825
It turns out that in the case you describe we were trying to connect
with "192.168.0.216.tester.com" as an IP address, which was causing the
Socket library to (quite correctly) die.
We're still not perfect, though; someone can now publish an SRV record
that points at an IP address rather than a hostname and we'll happily
accept it despite the fact that it's technically wrong. At least we
don't crash anymore, though.
More information about the Djabberd
mailing list