CVE-2021-44730

7.8 HIGH

📋 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

Products:
  • snapd
Versions: snapd versions before 2.54.3+18.04, 2.54.3+20.04, and 2.54.3+21.10.1
Operating Systems: Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 21.10, Fedora, Other Linux distributions using snapd
Default Config Vulnerable: ⚠️ Yes
Notes: Affects default installations of snapd on vulnerable versions. Requires local access to the system.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: LOW - This is a local privilege escalation requiring existing local access to the system.
🏢 Internal Only: HIGH - Any local user account (including compromised low-privilege accounts) can potentially exploit this to gain root access.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

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

linux

Tighten 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

linux

Ensure 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

📤 Share & Export