Skip to content

CVE-2023-31137 MaraDNS Integer Underflow Vulnerability in DNS Packet Decompression

HighCVSS 7.5 EPSS 1.1%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: yes · technical impact: partial
Technology
UbuntuDebian

Description

MaraDNS is open-source software that implements the Domain Name System (DNS). In version 3.5.0024 and prior, a remotely exploitable integer underflow vulnerability in the DNS packet decompression function allows an attacker to cause a Denial of Service by triggering an abnormal program termination.

The vulnerability exists in the decomp_get_rddata function within the Decompress.c file. When handling a DNS packet with an Answer RR of qtype 16 (TXT record) and any qclass, if the rdlength is smaller than rdata, the result of the line Decompress.c:886 is a negative number len = rdlength - total;. This value is then passed to the decomp_append_bytes function without proper validation, causing the program to attempt to allocate a massive chunk of memory that is impossible to allocate. Consequently, the program exits with an error code of 64, causing a Denial of Service.

One proposed fix for this vulnerability is to patch Decompress.c:887 by breaking if(len <= 0), which has been incorporated in version 3.5.0036 via commit bab062bde40b2ae8a91eecd522e84d8b993bab58.

Upgrade path

9 packages: 6 fixed.

PackageAffectedFixed inStatus
debian/maradns(Debian 11) < 2.0.13-1.4+deb11u1; = 2.0.13-1.4 2.0.13-1.4+deb11u1 Fixed
maradns < 3.4.10; >= 3.5.0001, < 3.5.0036 3.4.10, 3.5.0036 Fixed
ubuntu/maradns(Ubuntu 20.04) < 2.0.13-1.4+deb11u1build0.20.04.1; = 2.0.13-1.2build1; = 2.0.13-1.4; = 2.0.13-1.4build1 2.0.13-1.4+deb11u1build0.20.04.1 Fixed
ubuntu/maradns(Ubuntu 22.04) < 2.0.13-1.4+deb11u1build0.22.04.1; = 2.0.13-1.4build2 2.0.13-1.4+deb11u1build0.22.04.1 Fixed
ubuntu/maradns(Ubuntu Pro 16.04) < 2.0.13-1ubuntu0.1~esm1; = 2.0.11-1; = 2.0.13-1 2.0.13-1ubuntu0.1~esm1 Fixed
ubuntu/maradns(Ubuntu Pro 18.04) < 2.0.13-1.2ubuntu0.1~esm1; = 2.0.13-1.2 2.0.13-1.2ubuntu0.1~esm1 Fixed
debian linux = 10.0; = 11.0 No fix listed Versions listed
fedoraproject fedora = 37; = 38 No fix listed Versions listed
samboy MaraDNS = <= 3.5.0024 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
debian/maradns(Debian:11) < 2.0.13-1.4+deb11u1 2.0.13-1.4+deb11u1
debian/maradns(Debian:11) = 2.0.13-1.4 No fix listed
samboy MaraDNS = <= 3.5.0024 No fix listed
ubuntu/maradns(Ubuntu:22.04) < 2.0.13-1.4+deb11u1build0.22.04.1 2.0.13-1.4+deb11u1build0.22.04.1
maradns < 3.4.10 3.4.10
maradns >= 3.5.0001, < 3.5.0036 3.5.0036
fedoraproject fedora = 37 No fix listed
fedoraproject fedora = 38 No fix listed
debian linux = 10.0 No fix listed
debian linux = 11.0 No fix listed
ubuntu/maradns(Ubuntu:Pro:16.04) < 2.0.13-1ubuntu0.1~esm1 2.0.13-1ubuntu0.1~esm1
ubuntu/maradns(Ubuntu:Pro:16.04) = 2.0.11-1 No fix listed
ubuntu/maradns(Ubuntu:Pro:16.04) = 2.0.13-1 No fix listed
ubuntu/maradns(Ubuntu:Pro:18.04) < 2.0.13-1.2ubuntu0.1~esm1 2.0.13-1.2ubuntu0.1~esm1
ubuntu/maradns(Ubuntu:Pro:18.04) = 2.0.13-1.2 No fix listed
ubuntu/maradns(Ubuntu:20.04) < 2.0.13-1.4+deb11u1build0.20.04.1 2.0.13-1.4+deb11u1build0.20.04.1
ubuntu/maradns(Ubuntu:20.04) = 2.0.13-1.2build1 No fix listed
ubuntu/maradns(Ubuntu:20.04) = 2.0.13-1.4 No fix listed
ubuntu/maradns(Ubuntu:20.04) = 2.0.13-1.4build1 No fix listed
ubuntu/maradns(Ubuntu:22.04) = 2.0.13-1.4build2 No fix listed

References