CVE-2021-29627
📋 TL;DR
A double-free vulnerability in FreeBSD's accept filter implementation allows attackers to potentially execute arbitrary code or cause denial of service. This affects FreeBSD systems with listening sockets using accept filters. The vulnerability occurs when additional operations are performed on affected sockets after incorrect memory handling.
💻 Affected Systems
- FreeBSD
📦 What is this software?
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
Freebsd by Freebsd
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise if an attacker can trigger the double-free condition and achieve memory corruption.
Likely Case
Denial of service through system crash or instability when the double-free condition is triggered.
If Mitigated
Limited impact if systems are patched or don't use accept filters on listening sockets.
🎯 Exploit Status
Exploitation requires triggering specific socket operations after the initial memory handling error.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: FreeBSD 13.0-STABLE n245050+, 12.2-STABLE r369525+, 13.0-RC4 p0+, 12.2-RELEASE p6+
Vendor Advisory: https://security.FreeBSD.org/advisories/FreeBSD-SA-21:09.accept_filter.asc
Restart Required: Yes
Instructions:
1. Update FreeBSD using freebsd-update fetch && freebsd-update install
2. Rebuild kernel if using custom kernel
3. Reboot system to apply kernel updates
🔧 Temporary Workarounds
Disable accept filters
allRemove or disable accept filters on listening sockets to prevent triggering the vulnerability
Modify socket configuration to remove accept_filter directives
🧯 If You Can't Patch
- Restrict network access to affected systems using firewalls
- Monitor for abnormal socket behavior or system crashes
🔍 How to Verify
Check if Vulnerable:
Check FreeBSD version with 'uname -a' and compare against affected versions
Check Version:
uname -a
Verify Fix Applied:
Verify version is patched and check that freebsd-update reports no available security updates
📡 Detection & Monitoring
Log Indicators:
- Kernel panic logs
- System crash dumps
- Abnormal socket error messages
Network Indicators:
- Unexpected socket connection attempts
- Abnormal traffic to listening ports
SIEM Query:
source="kernel" AND ("panic" OR "double free" OR "use after free")