CVE-2021-4190

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

Large loop in the Kafka dissector in Wireshark 3.6.0 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. A flaw in the Kafka dissector allows attackers to crash Wireshark by injecting malicious packets or loading a crafted capture file, rendering the tool unusable and potentially disrupting network analysis operations. This vulnerability can be triggered remotely, making it a significant threat to network security monitoring.

02 // Vulnerability Mechanism

Step 1: Payload Delivery: An attacker crafts a malicious Kafka message or creates a capture file (.pcap or .pcapng) containing a malicious Kafka message. This message is specifically designed to trigger the vulnerable loop within the Kafka dissector. Step 2: Triggering the Vulnerability: The attacker either injects the malicious Kafka message directly onto a network being monitored by Wireshark (e.g., by sending the crafted message to a Kafka broker that Wireshark is configured to monitor) or provides the crafted capture file to a user who opens it in Wireshark. Step 3: Dissector Execution: When Wireshark processes the malicious Kafka message (either live or from a file), the Kafka dissector is invoked. Step 4: Loop Execution: The crafted message causes the vulnerable loop within the Kafka dissector to execute repeatedly, consuming excessive CPU resources. Step 5: Denial of Service: The excessive CPU usage leads to Wireshark becoming unresponsive and eventually crashing, resulting in a denial-of-service condition.

03 // Deep Technical Analysis

Root Cause: The vulnerability lies within the Kafka dissector in Wireshark version 3.6.0. Specifically, a large loop is triggered when processing Kafka protocol data. The dissector, responsible for parsing and displaying network traffic, enters an infinite or extremely long loop when encountering a malformed or crafted Kafka message. This leads to excessive CPU consumption and ultimately crashes the Wireshark application. The flaw is not a buffer overflow or memory corruption issue, but rather a logic error in the parsing of Kafka messages, causing an uncontrolled iteration. The lack of proper input validation allows for the triggering of this loop.

04 // Exploitation Status

The vulnerability is likely **Discovery Only**. While the vulnerability is known and the root cause is understood, there is no readily available public exploit. However, the simplicity of the vulnerability (a logic flaw) suggests that a proof-of-concept (PoC) could be easily created. The potential for DoS makes this a significant risk.

05 // Threat Intelligence

There is no specific APT or malware known to be actively exploiting this vulnerability. However, any actor seeking to disrupt network monitoring or analysis capabilities could potentially leverage this vulnerability. This vulnerability is not listed on the CISA KEV at this time, but could be added if actively exploited.

06 // Detection & Hunting

  • Monitor CPU usage of Wireshark processes. A sudden and sustained spike in CPU usage when processing Kafka traffic or opening capture files containing Kafka data is a strong indicator.

  • Analyze network traffic for unusual Kafka messages, particularly those with malformed headers or unexpected data structures. Use Wireshark itself to examine the Kafka traffic, looking for unusual patterns.

  • Examine Wireshark crash logs for error messages related to the Kafka dissector or infinite loops.

  • Implement network intrusion detection systems (IDS) rules to identify and block malicious Kafka messages based on known attack patterns (once identified).

07 // Remediation & Hardening

  • Upgrade to a patched version of Wireshark (3.6.1 or later) that addresses the vulnerability. This is the primary and most effective remediation step.

  • If upgrading is not immediately possible, restrict the use of Wireshark to trusted users and environments.

  • Implement input validation on Kafka messages if possible, especially if custom Kafka applications are used. This can help prevent the injection of malicious messages.

  • Monitor network traffic for suspicious Kafka messages and block them at the network edge.

08 // Affected Products

Wireshark 3.6.0
Advertisement

References & Intelligence

https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-4190.json
Source: cve@gitlab.com
Third Party Advisory
https://gitlab.com/wireshark/wireshark/-/issues/17811
Source: cve@gitlab.com
ExploitIssue TrackingPatchThird 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.wireshark.org/security/wnpa-sec-2021-22.html
Source: cve@gitlab.com
Vendor Advisory
https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-4190.json
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
https://gitlab.com/wireshark/wireshark/-/issues/17811
Source: af854a3a-2127-422b-91ae-364da2661108
ExploitIssue TrackingPatchThird 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.wireshark.org/security/wnpa-sec-2021-22.html
Source: af854a3a-2127-422b-91ae-364da2661108
Vendor Advisory