CVEfocus › CVE database › CVE-2023-31137

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

CVSS 7.5 HighEPSS 1.4% (higher than 73% of CVEs)Published 2023-05-09Updated 2025-02-13Assigner: GitHub_M

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.

CWE-191

What to do

Fixed builds are available from Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

2Fixed
3Fix pending

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04maradnsFixed2.0.13-1.4+deb11u1build0.22.04.1UBUNTU-CVE-2023-31137
Ubuntu 20.04maradnsFixed2.0.13-1.4+deb11u1build0.20.04.1UBUNTU-CVE-2023-31137
Ubuntu 18.04maradnsFix pending2.0.13-1.2ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2023-31137
Ubuntu 16.04maradnsFix pending2.0.13-1ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2023-31137
Ubuntu 14.04maradnsFix pending

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.