Summary
Authd PAM module up to version 0.3.4 can allow broker-managed users to impersonate any other user managed by the same broker and perform any PAM operation with it, including authenticating as them.
This is possible using tools such as su, sudo or ssh (and potentially others) that, so far, do not ensure that the PAM user at the end of the transaction is matching the one who initiated the transaction.
Authd 0.3.5 fixes this by not allowing changing the user unless it was never set before in the PAM stack.
su version that will include https://github.com/util-linux/util-linux/pull/3206 will not be affectedssh version that will include https://github.com/openssh/openssh-portable/pull/521 will not be affectedsudo version that will include https://github.com/sudo-project/sudo/pull/412 will not be affectedlogin not affectedpasswd not affected
An user can access as another user using its own credentials
Details
I feel we’ve a security issue that is due to the fact that we allow changing the user in the cases in which that’s already provided by PAM, I’ve not tested this using the entra-id broker but it’s reproducible with the example one, but unless I’m missing something it should be independent from the broker in use.
Basically, by going to the user selection page we allow to login as any user by entering the use own credentials.
See for example: https://asciinema.org/a/VIcjpDImomaGu0wxsJJxNdmlf or https://asciinema.org/a/CV3D1gaEhn2yclqSMKCnifYPo
Basically it’s possible to logging in as user1 using the credentials of user2 or user3.
The issue doesn’t affect login or passwd, but it does affect su and sshd, since in both cases they don’t check if the PAM_USER changed before the final authentication.
Now, while those tools should likely be fixed to only read the PAM_USER once pam gave them the final ok, I think authd should not allow changing the user at all when it has been provided by PAM.
Impact
The application does not adequately verify the identity of a user, device, or process before granting access. Typical impact: unauthorized access to functions or data reserved for authenticated parties.
CVE-2024-9313 has a CVSS score of 8.8 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.0.0-20240930103526-63e527496b01, 0.3.5); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
github.com/ubuntu/authd to 0.0.0-20240930103526-63e527496b01 or later; github.com/ubuntu/authd to 0.3.5 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2024-9313? CVE-2024-9313 is a high-severity improper authentication vulnerability in github.com/ubuntu/authd (go), affecting versions < 0.0.0-20240930103526-63e527496b01. It is fixed in 0.0.0-20240930103526-63e527496b01, 0.3.5. The application does not adequately verify the identity of a user, device, or process before granting access.
- How severe is CVE-2024-9313? CVE-2024-9313 has a CVSS score of 8.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/ubuntu/authd are affected by CVE-2024-9313? github.com/ubuntu/authd (go) versions < 0.0.0-20240930103526-63e527496b01 is affected.
- Is there a fix for CVE-2024-9313? Yes. CVE-2024-9313 is fixed in 0.0.0-20240930103526-63e527496b01, 0.3.5. Upgrade to this version or later.
- Is CVE-2024-9313 exploitable, and should I be worried? Whether CVE-2024-9313 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-9313 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-9313?
- Upgrade
github.com/ubuntu/authdto 0.0.0-20240930103526-63e527496b01 or later - Upgrade
github.com/ubuntu/authdto 0.3.5 or later
- Upgrade