Local privilege escalation via static-pointer double free
Published Nov 17, 2021 · Updated Sep 16, 2024
Memory corruption in Canonical AccountsService on Ubuntu 20.04 through 21.10 allows local users to gain root privileges via SetLanguage. In user_change_language_authorized_cb, g_autofree releases fallback_locale even though user_get_fallback_value returns a pointer to static storage, so repeated D-Bus calls double-free it. An unprivileged local account must remove its own .pam_environment file and invoke SetLanguage repeatedly; the root accounts-daemon then crashes or permits administrator-level code execution.
Summary
What happened
Memory corruption in Canonical AccountsService on Ubuntu 20.04 through 21.10 allows local users to gain root privileges via SetLanguage. In user_change_language_authorized_cb, g_autofree releases fallback_locale even though user_get_fallback_value returns a pointer to static storage, so repeated D-Bus calls double-free it. An unprivileged local account must remove its own .pam_environment file and invoke SetLanguage repeatedly; the root accounts-daemon then crashes or permits administrator-level code execution.
The record
- CVE
- CVE-2021-3939
- Published
- Nov 17, 2021
- Updated
- Sep 16, 2024
- Vendor
- Canonical
- Product
- AccountsService
- Classifications
- CWE-763, CWE-590, T1068
- Attack vector
- local
- Privileges
- authenticated
Timeline
How it unfolded
- Nov 17, 2021CVE publishedPublication date reported by the CVE source.
- Sep 16, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0.6.55-0ubuntu12~20.04 <0.6.55-0ubuntu12~20.04.5
- Affected versionversion=0.6.55-0ubuntu13 <0.6.55-0ubuntu13.3
- Affected versionversion=0.6.55-0ubuntu14 <0.6.55-0ubuntu14.1
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- GitHub Security Lab AccountsService proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo