Junglewise Threat Intelligence

CVE-2024-27397: Linux Kernel nf_tables use-after-free in set element timeout handling

CVE-2024-27397 · Severity: high · CVSS 7 · Published 2024-05-14

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability exists in the Linux kernel's networking subsystem (Netfilter) that could allow a local user to crash the system or potentially gain elevated privileges. The issue occurs because the system incorrectly handles the timing of when certain firewall rules expire, leading to a memory error known as a 'use-after-free.' This affects the nftables component, which is commonly used to manage network traffic and security policies on Linux systems.

Technical details

A use-after-free (UAF) vulnerability exists in the Linux kernel's nf_tables component (netfilter) due to a race condition in how set element timeouts are processed. Specifically, an element could expire while a control plane transaction is still unfinished because the system was not using a consistent timestamp across the transaction. This allows the garbage collection (GC) mechanism to remove elements that are still being referenced by active transactions. Attackers with local access can exploit this by manipulating nftables sets to trigger a UAF condition. The fix introduces a consistent transaction timestamp in the nftables per-namespace area to ensure elements do not expire prematurely during the control plane phase.

Affected products

  • Linux Linux Kernel 4.1 to 4.19.320, 4.20 to 5.4.282, 5.5 to 5.10.224, 5.11 to 5.15.165, 5.16 to 6.1.97, 6.2 to 6.6.84, 6.7 to 6.7.5, 6.8-rc1 to 6.8-rc3

Timeline

  • 2024-02-16: patched: Fix committed to stable kernel branches
  • 2024-05-14: disclosed: CVE published

References

Related threats