Skip to content
Fencer Vulns
high 7.5

CVE-2023-31137 json

MaraDNS Integer Underflow Vulnerability in DNS Packet Decompression

published 2023-05-09 3 y ago modified 2026-06-17 4 mo ago also EUVD-2023-35457

cvss
7.5
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.1%
EPSS 1.1% chance of exploitation in 30 days, percentile 66%
public exploits
0
none known

Summary

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.

Patch / fix

  • maradns maradns 3.4.10, 3.5.0036
  • maradns Debian 11 2.0.13-1.4+deb11u1

debian advisories DEBIAN-CVE-2023-31137

  • maradns Ubuntu 20.04 LTS 2.0.13-1.4+deb11u1build0.20.04.1
  • maradns Ubuntu 22.04 LTS 2.0.13-1.4+deb11u1build0.22.04.1
  • maradns Ubuntu Pro 16.04 LTS 2.0.13-1ubuntu0.1~esm1
  • maradns Ubuntu Pro 18.04 LTS 2.0.13-1.2ubuntu0.1~esm1

ubuntu advisories UBUNTU-CVE-2023-31137

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2023-31137 updated cvss 7.5

maradns: integer underflow in DNS packet decompression

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
yes
Technical impact
partial
Assessed
2 y ago

Exploit prediction

1.14% chance of exploitation in the next 30 days, higher than 66% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected products

  • samboy MaraDNS

Classification

Weakness
  • CWE-191 Integer Underflow (Wrap or Wraparound)

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.