CVE-2021-44730
📋 TL;DR
CVE-2021-44730 is a privilege escalation vulnerability in snapd where improper validation of the snap-confine binary location allows local attackers to create hardlinks to arbitrary binaries. When exploited, this enables attackers to execute unauthorized binaries with elevated privileges. This affects systems running vulnerable versions of snapd on Linux distributions.
💻 Affected Systems
- snapd
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Snapd by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
⚠️ Risk & Real-World Impact
Worst Case
Local attacker gains full root privileges on the system, enabling complete system compromise, data theft, and persistence.
Likely Case
Local user escalates privileges to root, gaining administrative control over the affected system.
If Mitigated
Attack fails due to proper access controls, SELinux/AppArmor restrictions, or the vulnerability being patched.
🎯 Exploit Status
Exploitation requires local access but is relatively straightforward once access is obtained. Public proof-of-concept code exists in security advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: snapd 2.54.3+18.04, 2.54.3+20.04, and 2.54.3+21.10.1 or later
Vendor Advisory: https://ubuntu.com/security/notices/USN-5292-1
Restart Required: No
Instructions:
1. Update snapd using your distribution's package manager. 2. For Ubuntu: sudo apt update && sudo apt upgrade snapd. 3. For Fedora: sudo dnf update snapd. 4. Verify the updated version is installed.
🔧 Temporary Workarounds
Restrict snap-confine binary permissions
linuxTighten permissions on the snap-confine binary to prevent hardlink creation
sudo chmod 0755 /usr/lib/snapd/snap-confine
sudo chown root:root /usr/lib/snapd/snap-confine
Enable AppArmor/SELinux restrictions
linuxEnsure mandatory access controls are active to limit binary execution
sudo aa-enforce /etc/apparmor.d/*snap*
sudo setenforce 1
🧯 If You Can't Patch
- Remove snapd package if not required: sudo apt remove snapd or sudo dnf remove snapd
- Implement strict access controls to limit local user accounts and monitor for privilege escalation attempts
🔍 How to Verify
Check if Vulnerable:
Check snapd version: snap version | grep snapd
Check Version:
snap version | grep snapd
Verify Fix Applied:
Verify snapd version is 2.54.3+18.04, 2.54.3+20.04, 2.54.3+21.10.1 or higher: snap version
📡 Detection & Monitoring
Log Indicators:
- Unusual snap-confine execution patterns in system logs
- Hardlink creation to snap-confine binary in audit logs
- Privilege escalation attempts from snap-related processes
Network Indicators:
- None - this is a local privilege escalation vulnerability
SIEM Query:
Process creation where parent process is snap-confine with unusual arguments OR File creation events modifying /usr/lib/snapd/snap-confine
🔗 References
- http://www.openwall.com/lists/oss-security/2022/02/18/2
- http://www.openwall.com/lists/oss-security/2022/02/23/1
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3QTBN7LLZISXIA4KU4UKDR27Q5PXDS2U/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XCGHG6LJAVJJ72TMART6A7N4Z6MSTGI7/
- https://ubuntu.com/security/notices/USN-5292-1
- https://www.debian.org/security/2022/dsa-5080
- http://www.openwall.com/lists/oss-security/2022/02/18/2
- http://www.openwall.com/lists/oss-security/2022/02/23/1
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3QTBN7LLZISXIA4KU4UKDR27Q5PXDS2U/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XCGHG6LJAVJJ72TMART6A7N4Z6MSTGI7/
- https://ubuntu.com/security/notices/USN-5292-1
- https://www.debian.org/security/2022/dsa-5080