Cloudanix VulnDB

CVE-2021-3939

High · 7.8

CVSS

7.8

EPSS

0.4%

Published

Nov 17, 2021

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

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

  1. Obtain local user access on target Ubuntu system
  2. Connect to system D-Bus and invoke SetLanguage method with malicious parameters
  3. Trigger double-free or use-after-free in accountsservice fallback_locale handling
  4. 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