CVE-2021-23134
📋 TL;DR
This CVE describes a Use After Free vulnerability in NFC sockets in the Linux Kernel that allows local attackers with CAP_NET_RAW capability to escalate privileges. It affects Linux Kernel versions before 5.12.4. In typical configurations, only privileged local users can trigger this issue.
💻 Affected Systems
- Linux Kernel
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Linux Kernel by Linux
The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...
Learn more about Linux Kernel →⚠️ Risk & Real-World Impact
Worst Case
Local privilege escalation to root, allowing complete system compromise.
Likely Case
Privileged local user gains root access, enabling installation of malware, data theft, or persistence mechanisms.
If Mitigated
Limited impact if CAP_NET_RAW capability is restricted and proper access controls are enforced.
🎯 Exploit Status
Exploitation requires local access and CAP_NET_RAW capability. No public exploit code has been identified.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Linux Kernel 5.12.4 and later
Vendor Advisory: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=c61760e6940d
Restart Required: Yes
Instructions:
1. Update Linux Kernel to version 5.12.4 or later. 2. Reboot the system to load the new kernel. 3. Verify the kernel version after reboot.
🔧 Temporary Workarounds
Remove CAP_NET_RAW capability
linuxRemove CAP_NET_RAW capability from users and processes that don't require it to prevent exploitation.
setcap -r /path/to/binary
capsh --drop=cap_net_raw -- -c 'command'
Disable NFC kernel module
linuxDisable NFC functionality if not required by unloading the kernel module.
rmmod nfc
echo 'blacklist nfc' >> /etc/modprobe.d/blacklist.conf
🧯 If You Can't Patch
- Restrict CAP_NET_RAW capability to only essential users and processes
- Implement strict access controls and monitor for privilege escalation attempts
🔍 How to Verify
Check if Vulnerable:
Check kernel version with 'uname -r'. If version is earlier than 5.12.4, system is vulnerable.
Check Version:
uname -r
Verify Fix Applied:
After patching, verify kernel version is 5.12.4 or later with 'uname -r'.
📡 Detection & Monitoring
Log Indicators:
- Kernel panic logs
- System crash dumps
- Unexpected privilege escalation in audit logs
Network Indicators:
- None - this is a local vulnerability
SIEM Query:
Search for kernel version strings earlier than 5.12.4 in system inventory data
🔗 References
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=c61760e6940d
- https://lists.debian.org/debian-lts-announce/2021/06/msg00019.html
- https://lists.debian.org/debian-lts-announce/2021/06/msg00020.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LZYORWNQIHNWRFYRDXBWYWBYM46PDZEN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QALNQT4LJFVSSA3MWCIECVY4AFPP4X77/
- https://security.netapp.com/advisory/ntap-20210625-0007/
- https://www.openwall.com/lists/oss-security/2021/05/11/4
- https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=c61760e6940d
- https://lists.debian.org/debian-lts-announce/2021/06/msg00019.html
- https://lists.debian.org/debian-lts-announce/2021/06/msg00020.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LZYORWNQIHNWRFYRDXBWYWBYM46PDZEN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QALNQT4LJFVSSA3MWCIECVY4AFPP4X77/
- https://security.netapp.com/advisory/ntap-20210625-0007/
- https://www.openwall.com/lists/oss-security/2021/05/11/4