Bug 2207550 (CVE-2023-31137) - CVE-2023-31137 maradns: integer underflow in DNS packet decompression
Summary: CVE-2023-31137 maradns: integer underflow in DNS packet decompression
Keywords:
Status: CLOSED UPSTREAM
Alias: CVE-2023-31137
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2207551
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-16 08:59 UTC by TEJ RATHI
Modified: 2023-05-16 23:43 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A remotely exploitable Integer Underflow vulnerability was found in MaraDNS in the DNS packet decompression function allows an attacker to cause a Denial of Service by triggering an abnormal program termination.
Clone Of:
Environment:
Last Closed: 2023-05-16 23:43:27 UTC
Embargoed:


Attachments (Terms of Use)

Description TEJ RATHI 2023-05-16 08:59:43 UTC
In MaraDNS 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.

https://github.com/samboy/MaraDNS/security/advisories/GHSA-58m7-826v-9c3c
https://github.com/samboy/MaraDNS/commit/bab062bde40b2ae8a91eecd522e84d8b993bab58
https://github.com/samboy/MaraDNS/blob/08b21ea20d80cedcb74aa8f14979ec7c61846663/dns/Decompress.c#L886

Comment 1 TEJ RATHI 2023-05-16 09:00:03 UTC
Created maradns tracking bugs for this issue:

Affects: fedora-all [bug 2207551]

Comment 2 Product Security DevOps Team 2023-05-16 23:43:25 UTC
This CVE Bugzilla entry is for community support informational purposes only as it does not affect a package in a commercially supported Red Hat product. Refer to the dependent bugs for status of those individual community products.


Note You need to log in before you can comment on or make changes to this bug.