Domain Name Relay Daemon (DNRD) Buffer Overflows May Let Remote Users Execute Arbitrary Code
SecurityTracker Alert ID: 1014557|
SecurityTracker URL: http://securitytracker.com/id/1014557
(Links to External Site)
Updated: Jun 15 2008|
Original Entry Date: Jul 22 2005
Denial of service via network, Execution of arbitrary code via network, User access via network|
Exploit Included: Yes |
Version(s): 2.19 and prior versions|
Two vulnerabilities were reported in the Domain Name Relay Daemon (DNRD). A remote user can cause the DNS service to crash or may be able to execute arbitrary code on the target system.|
A remote user can send specially crafted DNS packets that are larger than 268 bytes and have the Z and QR flags cleared to trigger a buffer overflow [CVE: CVE-2005-2315]. It may be possible to execute arbitrary code.
A remote user can send a specially crafted DNS packet with the QNAME field pointing to a buffer location that points back to the original QNAME location [CVE: CVE-2005-2316]. This infinite recursion will trigger a stack overflow and cause the daemon to crash.
Natanael Copa reported these vulnerabilities.
A remote user can cause the target service to crash.|
A remote user may be able to execute arbitrary code on the target system.
No solution was available at the time of this entry.|
Vendor URL: dnrd.sourceforge.net/ (Links to External Site)
|Underlying OS: Linux (Any), UNIX (Any)|
Source Message Contents
Subject: ports/83851: Update port: dns/dnrd Security update|
>Synopsis: Update port: dns/dnrd Security update
>Arrival-Date: Thu Jul 21 14:00:32 GMT 2005
>Originator: Natanael Copa
>Release: FreeBSD 5.4-RELEASE i386
System: FreeBSD vmfreebsd.example.com 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May 8 10:21:06 UTC 2005 r...@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
Buffer and stack overflow in dnrd-2.19 and older.
1) Buffer overflow (CAN-2005-2315)
* create a buffer, a DNS packet, bigger than 268 (256+12) bytes.
* Fill the buffer with random data.
* Clear the Z and QR flags.
* Send it to dnrd.
* Repeat til dnrd dies.
Impact : this could probably be exploited to perform remote execution.
However, dnrd runs in an chroot environment and runs as non-root.
2) Infinite recursion causes stack overflow (CAN-2005-2316)
* Create a buffer, a DNS packet.
* in the QNAME, use Message compression (see rfc 4.1.4). Set the
pointer to point on another location in the buffer.
* On this new location set another pointer to point pack to the
original QNAME location. In other words, its a circular buffer.
Dnrd will recurse until the stack is overflowed.
To reproduce #2 its important to not have any valid digits between the
loops. It must only contain pointers.
Impact : crash -> DoS
--- dnrd-ports-2.19-2.19.1.diff begins here ---
diff -bruN dnrd.orig/Makefile dnrd/Makefile
--- dnrd.orig/Makefile Tue Jul 19 14:04:35 2005
+++ dnrd/Makefile Tue Jul 19 14:04:52 2005
@@ -6,7 +6,7 @@
diff -bruN dnrd.orig/distinfo dnrd/distinfo
--- dnrd.orig/distinfo Tue Jul 19 14:04:35 2005
+++ dnrd/distinfo Thu Jul 21 15:25:47 2005
@@ -1,2 +1,2 @@
-MD5 (dnrd-2.19.tar.gz) = b8749250450f7d8de9a51af035e009eb
-SIZE (dnrd-2.19.tar.gz) = 156241
+MD5 (dnrd-2.19.1.tar.gz) = 58de30f0b09e333ca008444ca25848bc
+SIZE (dnrd-2.19.1.tar.gz) = 157686
--- dnrd-ports-2.19-2.19.1.diff ends here ---