HIGH CISA KEV
netfilter NFTables Verdict UAF
CVE-2024-1086
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
A use-after-free vulnerability in the Linux kernel's netfilter: nf_tables component can be exploited to achieve local privilege escalation. The nft_verdict_init() function allows positive values as drop error within the hook verdict, and hence the nf_hook_slow() function can cause a double free vulnerability when NF_DROP is issued with a drop error which resembles NF_ACCEPT. We recommend upgrading past commit f342de4e2f33e0e39165d8639387aa6c19dff660.
02KernelScan AI Analysis
Risk summary
This vulnerability allows local attackers with netfilter configuration privileges to escalate to root access by exploiting memory corruption in the kernel's packet filtering subsystem. The vulnerability has been actively exploited and is listed in CISA's Known Exploited Vulnerabilities catalog.
Vulnerability analysis
Summary: A use-after-free vulnerability in netfilter's nf_tables component allows local privilege escalation through malformed verdict parameters.
Root Cause: The nft_verdict_init() function incorrectly allowed positive values as drop error codes within hook verdicts. When NF_DROP is issued with a positive error value that resembles NF_ACCEPT (value 1), the nf_hook_slow() function in core.c assumes the upper 16 bits contain a valid negative errno or 0, leading to improper memory handling and a double-free condition.
Attack Mechanism: An attacker with local access can craft malicious netfilter rules containing NF_DROP verdicts with positive error values. When these rules are processed, the kernel misinterprets the verdict parameters, causing memory corruption that can be exploited for privilege escalation.
Attack Surface: Local attack requiring the ability to configure netfilter rules, typically requiring elevated privileges or specific capabilities like CAP_NET_ADMIN.
Fix Mechanism: The patch reverts commit e0abdadcc6e1 and restricts verdict parameter validation to only accept specific valid verdict codes (NF_ACCEPT, NF_DROP, NF_QUEUE, NFT_CONTINUE, NFT_BREAK, NFT_RETURN) without allowing arbitrary parameters. This prevents the injection of positive values that could be misinterpreted as NF_ACCEPT.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| mainline | 6.8 | f342de4e2f33 |