The CVE number says 2022, the NVD date says 2024, and CISA says it’s being exploited. Here’s the story.

At a glance

  • CVE: CVE-2022-2586
  • Severity: depends who you ask. NVD scores it 7.8 (High). Canonical, which assigned the CVE, gave it 5.3 (Medium), and Red Hat rates it Moderate (6.7). They all agree it’s a local bug: the attacker has to be running code on the machine first.
  • Affected: Linux from 3.16 up to (but not including) 4.14.316, 4.19.256, 5.4.211, 5.10.137, 5.15.61, 5.18.18 and 5.19.2. Red Hat says RHEL 6 and 7 aren’t affected; RHEL 8 and 9 were.
  • Known exploited: Yes. CISA added it to its Known Exploited Vulnerabilities (KEV) catalog on 2024-06-26.

What’s going on

nf_tables is the engine behind nftables, the modern Linux firewall. Rules live in tables, and tables can hold sets (lists of addresses, ports and so on). The bug: a rule object or expression in one table could point at a set in a different table. Delete that other table and the reference keeps pointing at memory that’s been freed. That’s a use-after-free, and attackers can often turn those into running code inside the kernel.

Team Orca of Sea Security showed it could be used for local privilege escalation and reported it through Trend Micro’s Zero Day Initiative. Exploiting it needs CAP_NET_ADMIN in any user or network namespace. On systems that let ordinary users create user namespaces, that’s within reach of any local account.

Why the odd dates? Canonical disclosed the bug on oss-security on 2022-08-09 and fixes went out that year, but NVD didn’t publish the record until 2024-01-08.

For web servers, this is local privilege escalation. If an attacker gets a shell as your web user, this is a route to root on unpatched kernels.

Timeline

  • Disclosed: 2022-08-09 (oss-security, with fixes sent to the netfilter developers the same day)
  • Distro patches: Debian 11 got it in 5.10.136-1 (DSA-5207-1); Ubuntu published a series of notices starting with USN-5557-1; Red Hat shipped RHEL 8 updates on 2022-11-08 and RHEL 9 on 2022-11-15
  • Published to NVD: 2024-01-08
  • Added to CISA KEV: 2024-06-26

== UPDATE ==

Fixes have been out since 2022, so this is about catching any boxes that slipped through.

  • Patch available: Yep.
  • Fixed in: upstream 4.14.316, 4.19.256, 5.4.211, 5.10.137, 5.15.61, 5.18.18, 5.19.2 and later. Distro examples: Debian 11 “bullseye” 5.10.136-1, Debian 10 “buster” 4.19.260-1 (DLA-3131-1), RHEL 8 4.18.0-425.3.1.el8 and RHEL 9 5.14.0-162.6.1.el9_1. Ubuntu users should check the Ubuntu CVE tracker for their release.
  • How to apply: update the kernel and reboot: sudo apt update && sudo apt upgrade on Debian/Ubuntu or sudo dnf upgrade --refresh on RHEL and friends. Then check uname -r.
  • If you can’t patch yet: Red Hat says there’s no practical mitigation. Because the attack needs CAP_NET_ADMIN inside a namespace, turning off unprivileged user namespaces on hosts that don’t need them makes it harder for an ordinary account to reach the bug. On Debian/Ubuntu that’s sudo sysctl -w kernel.unprivileged_userns_clone=0; on RHEL, set user.max_user_namespaces=0 in a file under /etc/sysctl.d/ and run sudo sysctl --system. Skip this on container hosts that need user namespaces, and treat it as a stopgap, not a fix.

References