CVE-2021-4184

HIGH7.5/ 10.0
Share:
Published: December 30, 2021 at 10:15 PM
Modified: November 3, 2025 at 10:15 PM
Source: cve@gitlab.com

Vulnerability Description

Infinite loop in the BitTorrent DHT dissector in Wireshark 3.6.0 and 3.4.0 to 3.4.10 allows denial of service via packet injection or crafted capture file

CVSS Metrics

Base Score
7.5
Severity
HIGH
Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Weaknesses (CWE)

Source: nvd@nist.gov

AI Security Analysis

01 // Technical Summary

Wireshark, a widely used network protocol analyzer, is vulnerable to a denial-of-service (DoS) attack due to an infinite loop within its BitTorrent DHT dissector. Attackers can trigger this vulnerability by injecting malicious packets or providing a crafted capture file, causing Wireshark to consume excessive resources and become unresponsive, potentially disrupting network analysis and security monitoring.

02 // Vulnerability Mechanism

Step 1: Payload Delivery: An attacker crafts a malicious DHT packet or creates a capture file (.pcap or .pcapng) containing such a packet. This packet is designed to trigger the vulnerability within the Wireshark DHT dissector.

Step 2: Packet Injection (Live Capture): If the attacker is performing a live capture, the malicious packet is injected onto the network. Wireshark, configured to capture network traffic, intercepts the packet.

Step 3: File Loading (Capture File): If the attack involves a capture file, the attacker provides the crafted .pcap or .pcapng file to a user or system administrator who then opens it in Wireshark.

Step 4: Dissection Trigger: Wireshark's DHT dissector attempts to parse the malicious packet. The crafted packet contains data that, when processed by the flawed logic, causes the dissector to enter an infinite loop.

Step 5: Resource Exhaustion: The infinite loop consumes CPU resources, leading to high CPU utilization and potentially causing Wireshark to become unresponsive or crash. This constitutes a denial-of-service condition.

03 // Deep Technical Analysis

The vulnerability lies within the BitTorrent DHT dissector in Wireshark. Specifically, an infinite loop is triggered when processing malformed or crafted DHT packets. The dissector, responsible for parsing and interpreting DHT protocol data, enters an endless cycle due to a logic error in how it handles certain DHT message types or data structures. This error likely stems from incorrect boundary checks or improper handling of recursive data structures within the DHT protocol implementation. When the dissector encounters the problematic data, it repeatedly attempts to process it, consuming CPU resources and preventing the program from progressing. The root cause is a flaw in the parsing logic, leading to a control flow that never terminates under specific input conditions. This is not a buffer overflow or memory corruption issue, but a logic error that results in a resource exhaustion condition.

References & Intelligence

https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-4184.json
Source: cve@gitlab.com
Third Party Advisory
https://gitlab.com/wireshark/wireshark/-/issues/17754
Source: cve@gitlab.com
ExploitIssue TrackingThird Party Advisory
https://lists.debian.org/debian-lts-announce/2022/03/msg00041.html
Source: cve@gitlab.com
Mailing ListThird Party Advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Q6XGBKWSQFCVYUN4ZK3O3NJIFP3OAFVT/
Source: cve@gitlab.com
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/R5AEK3XTOIOGCGUILUFISMGX54YJXWGJ/
Source: cve@gitlab.com
https://security.gentoo.org/glsa/202210-04
Source: cve@gitlab.com
Third Party Advisory
https://www.oracle.com/security-alerts/cpuapr2022.html
Source: cve@gitlab.com
Third Party Advisory
https://www.wireshark.org/security/wnpa-sec-2021-18.html
Source: cve@gitlab.com
Vendor Advisory
https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-4184.json
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://gitlab.com/wireshark/wireshark/-/issues/17754
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitIssue TrackingThird Party Advisory
https://lists.debian.org/debian-lts-announce/2022/03/msg00041.html
Source: af854a3a-2127-422b-91ae-364da2661108
Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2024/09/msg00049.html
Source: af854a3a-2127-422b-91ae-364da2661108
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Q6XGBKWSQFCVYUN4ZK3O3NJIFP3OAFVT/
Source: af854a3a-2127-422b-91ae-364da2661108
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/R5AEK3XTOIOGCGUILUFISMGX54YJXWGJ/
Source: af854a3a-2127-422b-91ae-364da2661108
https://security.gentoo.org/glsa/202210-04
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://www.oracle.com/security-alerts/cpuapr2022.html
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://www.wireshark.org/security/wnpa-sec-2021-18.html
Source: af854a3a-2127-422b-91ae-364da2661108
Vendor Advisory
CVE-2021-4184 - HIGH Severity (7.5) | Free CVE Database | 4nuxd