CVE-2021-4184

Source: cve@gitlab.com

HIGH
7.5
Published: December 30, 2021 at 10:15 PM
Modified: November 3, 2025 at 10:15 PM

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. An attacker can trigger this vulnerability by injecting malicious packets or providing a crafted capture file, leading to a complete service outage for users of the affected Wireshark versions.

02 // Vulnerability Mechanism

Step 1: Packet Injection/Capture File Delivery: The attacker either injects malicious DHT packets directly onto a network monitored by Wireshark or provides a crafted capture file containing malicious DHT packets to a user who will open it in Wireshark.

Step 2: Wireshark Processing: The victim user opens the capture file or Wireshark captures the malicious packets.

Step 3: DHT Dissector Activation: Wireshark's DHT dissector is activated to analyze the BitTorrent DHT traffic.

Step 4: Infinite Loop Trigger: The malicious DHT packet triggers the vulnerability within the DHT dissector, causing an infinite loop.

Step 5: Resource Exhaustion: The infinite loop consumes CPU resources, leading to high CPU utilization.

Step 6: Denial of Service: Wireshark becomes unresponsive or crashes, effectively denying service to the user.

03 // Deep Technical Analysis

The vulnerability lies within the BitTorrent Distributed Hash Table (DHT) dissector in Wireshark. Specifically, the dissector contains a logic flaw that allows for an infinite loop to occur during the parsing of DHT packets. This is triggered by a crafted DHT packet that causes the dissector to repeatedly process a specific data structure without ever exiting the processing loop. This leads to excessive CPU consumption, effectively causing a denial-of-service (DoS) condition. The root cause is likely an improper handling of edge cases or malformed data within the DHT packet parsing logic, leading to an uncontrolled iteration within a loop. The specific function or logic responsible for this infinite loop is within the DHT dissector's processing of DHT messages, likely related to how it handles node ID lookups or routing table updates. The lack of proper bounds checking or input validation on the received DHT packets allows the crafted input to trigger the infinite loop.

04 // Exploitation Status

Public PoC

05 // Threat Intelligence

While no specific APT groups are directly linked to exploiting this vulnerability, the ease of exploitation and potential for DoS make it attractive for various attackers. This vulnerability is not listed on the CISA KEV list.

06 // Detection & Hunting

  • High CPU utilization by Wireshark processes.

  • Unusually long processing times when opening or capturing network traffic.

  • Network traffic analysis revealing malformed or suspicious DHT packets.

  • Examination of Wireshark crash logs for errors related to the DHT dissector.

  • Monitoring for excessive network traffic associated with DHT protocol.

07 // Remediation & Hardening

  • Upgrade Wireshark to a patched version (3.6.1 or later, or 3.4.11 or later).

  • Restrict access to Wireshark to trusted users and networks.

  • Implement network intrusion detection systems (IDS) to identify and block malicious DHT packets.

  • Regularly update Wireshark and other software to patch known vulnerabilities.

  • Educate users about the risks of opening untrusted capture files.

08 // Affected Products

Wireshark 3.6.0Wireshark 3.4.0 to 3.4.10

09 // Discovered Proof of Concept Links

Advertisement

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