CVE-2021-3939
High · 7.8CVSS
7.8
EPSS
0.4%
Published
Nov 17, 2021
CISA due date
—
Cloudanix analysis
A flaw in how Ubuntu handles language settings on the login screen lets local users crash or take over the computer if not updated.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Use-after-free memory corruption in accountsservice caused by Ubuntu patch freeing static storage for fallback_locale in user_change_language_authorized_cb, reachable over D-Bus SetLanguage call.
Why it matters to the business
Local attackers on affected Ubuntu systems can gain elevated privileges, potentially leading to full system compromise; high prevalence in Ubuntu environments increases operational risk for organizations running unpatched releases.
How an attack unfolds
An attacker with local access sends a crafted D-Bus message invoking SetLanguage, triggering the flawed callback that frees static memory; subsequent use of the dangling pointer results in memory corruption that can be leveraged for code execution.
How to fix it
Upgrade accountsservice to fixed versions 0.6.55-0ubuntu12~20.04.5, 0.6.55-0ubuntu13.3 or 0.6.55-0ubuntu14.1 (or later) via package manager; restart the accounts-daemon service after update.
How to confirm the fix worked
Verify installed package version matches or exceeds listed fixed releases using dpkg or apt; confirm service restarts cleanly and test SetLanguage D-Bus calls under controlled conditions.
Typical attack path
- Obtain local user access on target Ubuntu system
- Connect to system D-Bus and invoke SetLanguage method with malicious parameters
- Trigger double-free or use-after-free in accountsservice fallback_locale handling
- Exploit resulting memory corruption for privilege escalation
How to detect it
Review system and D-Bus logs around accountsservice crashes or unexpected restarts; look for repeated SetLanguage method calls from untrusted local sessions in journalctl or syslog.
What your security team should do
- Prioritize patching all Ubuntu systems running vulnerable accountsservice versions
- Monitor package update channels for accountsservice regressions
- Restrict unprivileged local D-Bus access where feasible until patches are applied
The record
Ubuntu-specific modifications to accountsservice (in patch file debian/patches/0010-set-language.patch) caused the fallback_locale variable, pointing to static storage, to be freed, in the user_change_language_authorized_cb function. This is reachable via the SetLanguage dbus function. This is fixed in versions 0.6.55-0ubuntu12~20.04.5, 0.6.55-0ubuntu13.3, 0.6.55-0ubuntu14.1.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Ubuntu:18.04:LTS | accountsservice | 0 | 0.6.45-1ubuntu1.3 |
| Ubuntu:20.04:LTS | accountsservice | 0 | 0.6.55-0ubuntu12~20.04.5 |
| Ubuntu:22.04:LTS | accountsservice | 0 | 0.6.55-3ubuntu2 |
Related vulnerabilities
- CVE-2023-3297 In Ubuntu's accountsservice an unprivileged local attacker can trigger a use-after-free… Also affects accountsservice
- CVE-2022-1804 accountsservice no longer drops permissions when writing .pam_environment Also affects accountsservice
- CVE-2026-112893 Pillow is a Python imaging library. CWE-763
- CVE-2026-98160 In the Linux kernel, the following vulnerability has been resolved: staging: rtl8723bs… CWE-763
- CVE-2026-74860 A flaw was found in libxml2 with Python bindings enabled. CWE-763
- CVE-2026-84131 Privilege escalation due to invalid pointer in the Graphics component. CWE-763
- CVE-2023-20511 Release of an invalid pointer in the AMD kernel mode driver (KMD) could allow a… CWE-763
- CVE-2026-19315 A type confusion vulnerability in the iked process of WatchGuard Fireware OS allows a… CWE-763