Miggo Logo

CVE-2025-5689: New authd users logging in via SSH are members of the root group

6.4

CVSS Score
3.1

Basic Information

EPSS Score
0.01109%
Published
6/16/2025
Updated
6/17/2025
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/ubuntu/authdgo< 0.5.40.5.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability (CVE-2025-5689) occurs when a new authd user logs in via SSH for the first time. Such users were incorrectly assigned to the 'root' group (GID 0) for their SSH session. This was due to the temporary user records created during the pre-authentication Name Service Switch (NSS) request not having an explicit Group ID (GID) set.

In Go, uninitialized integer fields (like GID in the types.UserEntry struct) default to their zero value, which is 0. GID 0 is conventionally the GID of the 'root' group.

The analysis of the patch 619ce8e55953b970f1765ddaad565081538151ab reveals that three key functions were responsible for this behavior:

  1. github.com/ubuntu/authd/internal/users/tempentries.preAuthUserEntry: This function creates types.UserEntry for pre-authentication. The patch added GID: user.uid, where previously GID was not set, and a TODO comment indicated awareness of it defaulting to 0.
  2. github.com/ubuntu/authd/internal/users/tempentries.userEntry: Similar to preAuthUserEntry, this function creates types.UserEntry for temporary users and also lacked explicit GID assignment prior to the patch.
  3. github.com/ubuntu/authd/internal/services/user.(*Service).userPreCheck: This service method returns a types.UserEntry. The patch added u.GID = u.UID, indicating that GID was not set before this change.

These functions, in their pre-patch state, would return or use types.UserEntry objects where the GID field was 0. This user entry was then used by the system, leading to the new user being treated as a member of the root group for that session. The fix involved explicitly setting the GID to be the same as the UID for these temporary/new users, adhering to the User Private Groups (UPG) convention, and ensuring this GID does not conflict with existing groups.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t W**n *n *ut** us*r lo*s in vi* SS* *or t** *irst tim* (m**nin* t**y *o not y*t *xist in t** *ut** us*r **t***s*) *n* su***ss*ully *ut**nti**t*s vi* t** *on*i*ur** *rok*r, t** us*r is *onsi**r** * m*m**r o* t** root *roup in t** *ont*xt o*

Reasoning

T** vuln*r**ility (*V*-****-****) o**urs w**n * n*w *ut** us*r lo*s in vi* SS* *or t** *irst tim*. Su** us*rs w*r* in*orr**tly *ssi*n** to t** 'root' *roup (*I* *) *or t**ir SS* s*ssion. T*is w*s *u* to t** t*mpor*ry us*r r**or*s *r**t** *urin* t** p