dos with bad srv record

Martin Atkins mart at
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:, recv:
> 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
> 833 DEBUG DJabberd.DNS                             Skipping lookup for '', it is already the IP
> 833 DEBUG DJabberd.Connection.DialbackVerify       Attempting to connect to ''
> Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/local/lib/perl5/5.8.8/mach/ line 373.
> ---
> srv record looks like:

Thanks for reporting it. Sorry it took so long for anyone to reply.

I checked in a fix:

It turns out that in the case you describe we were trying to connect 
with "" 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