CVE-2023-3297
📋 TL;DR
CVE-2023-3297 is a use-after-free vulnerability in Ubuntu's accountsservice that allows an unprivileged local attacker to potentially execute arbitrary code or crash the accounts-daemon process by sending a specially crafted D-Bus message. This affects Ubuntu systems with accountsservice installed, which is typically present by default.
💻 Affected Systems
- accountsservice (accounts-daemon)
📦 What is this software?
Accountsservice by Canonical
Accountsservice by Canonical
Accountsservice by Canonical
Accountsservice by Canonical
Accountsservice 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 privilege escalation to root, complete system compromise, or persistent backdoor installation.
Likely Case
Denial of service (crashing accounts-daemon) or limited local privilege escalation affecting user account management.
If Mitigated
Minimal impact if proper access controls restrict local user accounts and D-Bus communication.
🎯 Exploit Status
Exploit requires local access and knowledge of D-Bus messaging. Proof-of-concept code is publicly available in security advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 22.07.5-2ubuntu1.3 for Ubuntu 22.04 LTS, 0.6.55-0ubuntu12~20.04.6 for Ubuntu 20.04 LTS
Vendor Advisory: https://ubuntu.com/security/notices/USN-6190-1
Restart Required: Yes
Instructions:
1. Update package list: sudo apt update
2. Upgrade accountsservice: sudo apt install --only-upgrade accountsservice
3. Restart accounts-daemon: sudo systemctl restart accounts-daemon
🔧 Temporary Workarounds
Restrict D-Bus access
linuxLimit which users can send D-Bus messages to accounts-daemon using D-Bus policy configuration
sudo nano /etc/dbus-1/system.d/org.freedesktop.Accounts.conf
Disable accountsservice if not needed
linuxStop and disable the accounts-daemon service if user account management via D-Bus is not required
sudo systemctl stop accounts-daemon
sudo systemctl disable accounts-daemon
🧯 If You Can't Patch
- Implement strict access controls to limit local user accounts and monitor for suspicious D-Bus activity
- Use SELinux/AppArmor to restrict accounts-daemon process capabilities and system access
🔍 How to Verify
Check if Vulnerable:
Check accountsservice version: dpkg -l accountsservice | grep ^ii
Check Version:
dpkg -l accountsservice | grep ^ii | awk '{print $3}'
Verify Fix Applied:
Verify installed version matches patched version and accounts-daemon is running: systemctl status accounts-daemon
📡 Detection & Monitoring
Log Indicators:
- Unusual D-Bus messages to accounts-daemon in /var/log/syslog
- Accounts-daemon crashes or restarts in system logs
Network Indicators:
- Local D-Bus communication patterns (not network exploitable)
SIEM Query:
process:accounts-daemon AND (event:crash OR event:restart) OR dbus.destination:org.freedesktop.Accounts AND dbus.interface:org.freedesktop.Accounts.User
🔗 References
- https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/2024182
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-3297
- https://securitylab.github.com/advisories/GHSL-2023-139_accountsservice/
- https://ubuntu.com/security/notices/USN-6190-1
- https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/2024182
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-3297
- https://securitylab.github.com/advisories/GHSL-2023-139_accountsservice/
- https://ubuntu.com/security/notices/USN-6190-1