CVE-2022-3328
📋 TL;DR
CVE-2022-3328 is a race condition vulnerability in snap-confine's must_mkdir_and_open_with_perms() function that could allow local privilege escalation. Attackers could exploit this to gain root privileges on affected systems. This affects systems using snap packages on vulnerable versions of snapd.
💻 Affected Systems
- snapd
- snap-confine
📦 What is this software?
Snapd by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux 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, enabling complete system compromise, data theft, and persistence establishment.
Likely Case
Local user escalates privileges to root, allowing unauthorized access to sensitive files and system modifications.
If Mitigated
With proper patching, the vulnerability is eliminated; with proper access controls, impact is limited to authorized users.
🎯 Exploit Status
Exploitation requires local access and knowledge of race condition timing. Proof-of-concept code has been published.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: snapd 2.57.5 and later
Vendor Advisory: https://ubuntu.com/security/notices/USN-5753-1
Restart Required: No
Instructions:
1. Update snapd package: sudo apt update && sudo apt install snapd
2. Verify version: snap version
3. Ensure snapd version is 2.57.5 or higher
🔧 Temporary Workarounds
Disable snap services
linuxTemporarily disable snap services if patching is not immediately possible
sudo systemctl stop snapd.service
sudo systemctl disable snapd.service
🧯 If You Can't Patch
- Restrict local user access to vulnerable systems
- Implement strict privilege separation 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.57.5 or higher: snap version
📡 Detection & Monitoring
Log Indicators:
- Unusual snapd process activity
- Privilege escalation attempts in system logs
- Failed snap package installations
Network Indicators:
- None - local exploit only
SIEM Query:
source="systemd" AND process="snapd" AND (event="privilege_escalation" OR event="permission_denied")