Bug 2319212 (CVE-2024-10041)

Summary: CVE-2024-10041 pam: libpam: Libpam vulnerable to read hashed password
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A vulnerability was found in PAM. The secret information is stored in memory, where the attacker can trigger the victim program to execute by sending characters to its standard input (stdin). As this occurs, the attacker can train the branch predictor to execute an ROP chain speculatively. This flaw could result in leaked passwords, such as those found in /etc/shadow while performing authentications.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2328933    
Bug Blocks:    
Deadline: 2024-10-18   

Description OSIDB Bzimport 2024-10-16 15:23:48 UTC
A vulnerability was found in PAM. The secret is in memory, while the attacker can trigger the victim program to execute by sending characters to its stdin. In-between, they then train the branch predictor to speculatively execute a ROP chain.

Moreover, when stdin is a pipe or file, the FILE IO buffer
malloc'd will receive the just-freed IO buffer that was used to read
/etc/shadow, so it is also possible to have the secret conveniently available in the
uninitialized memory of the stdin's FILE buf.=20

This makes several registers reference the /etc/shadow contents during
the read-loop of the fgets call that the polkit agent uses in the pam
conversation.=20

The attack is difficult to pull of:
- Attacker needs to find a gadget chain in the mapped-in executable
memory of the victim
- Attacker needs to trigger TLB entries to be prefetched to win the race
and fit the transient operations in the misspeculation window.
- Attacker needs to tweak the attack to break ASLR. This they also can
do using Spectre as well.

Comment 1 errata-xmlrpc 2024-11-19 04:38:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.4 Extended Update Support

Via RHSA-2024:9941 https://access.redhat.com/errata/RHSA-2024:9941

Comment 2 errata-xmlrpc 2024-11-26 15:20:01 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:10379 https://access.redhat.com/errata/RHSA-2024:10379

Comment 3 errata-xmlrpc 2024-12-17 12:32:12 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:11250 https://access.redhat.com/errata/RHSA-2024:11250