# CVE-2023-4641: Shadow-utils: possible password leak during passwd(1) change

> An attacker with sufficient access can retrieve a user's password from memory if the second password entry attempt fails during a passwd change.

- **Severity:** Medium 4.7 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Dec 2023
- **Updated:** 3 Nov 2025
- **Also known as:** ALSA-2023:6632, ALSA-2023:7112, AZL-32253, BELL-CVE-2023-4641, CLSA-2024-1719246768, CLSA-2026-1779267466, CLSA-2026-1779352627, CLSA-2026-1779354447, DEBIAN-CVE-2023-4641, ECHO-c16b-48d0-7da6, GHSA-6ggv-mmg2-jf4r, MGASA-2023-0294, OESA-2023-1687, RHSA-2023:6632, RHSA-2023:7112, RHSA-2024:0417, RHSA-2024:2577, SUSE-SU-2023:3591-1, SUSE-SU-2023:4023-1, SUSE-SU-2023:4024-1, SUSE-SU-2023:4025-1, SUSE-SU-2023:4027-1, UBUNTU-CVE-2023-4641, USN-6640-1, openSUSE-SU-2026:10081-1

## What is CVE-2023-4641?

CVE-2023-4641 is a medium-severity vulnerability in Redhat Enterprise Linux, published on 27 Dec 2023. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

A flaw was found in shadow-utils. When asking for a new password, shadow-utils asks the password twice. If the password fails on the second attempt, shadow-utils fails in cleaning the buffer used to store the first entry. This may allow an attacker with enough access to retrieve the password from the memory.

Weakness: CWE-287 (Improper Authentication), CWE-303 (Incorrect Implementation of Authentication Algorithm)

## Which versions are affected by CVE-2023-4641?

It affects 9 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `shadow-utils` | AlmaLinux:8 | All versions | 2:4.6-19.el8 |
| `shadow-utils-subid` | AlmaLinux:8 | All versions | 2:4.6-19.el8 |
| `shadow-utils-subid-devel` | AlmaLinux:8 | All versions | 2:4.6-19.el8 |
| `shadow-utils` | AlmaLinux:9 | All versions | 2:4.9-8.el9 |
| `shadow-utils-subid` | AlmaLinux:9 | All versions | 2:4.9-8.el9 |
| `shadow-utils-subid-devel` | AlmaLinux:9 | All versions | 2:4.9-8.el9 |
| `shadow-utils` | Red Hat:enterprise_linux:8::baseos | All versions | 2:4.6-19.el8 |
| `shadow-utils-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 2:4.6-19.el8 |
| `shadow-utils-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 2:4.6-19.el8 |
| `shadow-utils-subid` | Red Hat:enterprise_linux:8::baseos | All versions | 2:4.6-19.el8 |
| `shadow-utils-subid-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 2:4.6-19.el8 |
| `shadow-utils-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 2:4.6-19.el8 |
| `shadow-utils-debugsource` | Red Hat:enterprise_linux:8::crb | All versions | 2:4.6-19.el8 |
| `shadow-utils-subid-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 2:4.6-19.el8 |
| `shadow-utils-subid-devel` | Red Hat:enterprise_linux:8::crb | All versions | 2:4.6-19.el8 |
| `shadow-utils` | Red Hat:enterprise_linux:9::baseos | All versions | 2:4.9-8.el9 |
| `shadow-utils-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 2:4.9-8.el9 |
| `shadow-utils-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 2:4.9-8.el9 |
| `shadow-utils-subid` | Red Hat:enterprise_linux:9::baseos | All versions | 2:4.9-8.el9 |
| `shadow-utils-subid-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 2:4.9-8.el9 |
| `shadow-utils-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 2:4.9-8.el9 |
| `shadow-utils-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 2:4.9-8.el9 |
| `shadow-utils-subid-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 2:4.9-8.el9 |
| `shadow-utils-subid-devel` | Red Hat:enterprise_linux:9::crb | All versions | 2:4.9-8.el9 |
| `shadow-utils` | Red Hat:rhel_eus:8.6::baseos | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-debuginfo` | Red Hat:rhel_eus:8.6::baseos | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-debugsource` | Red Hat:rhel_eus:8.6::baseos | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-subid` | Red Hat:rhel_eus:8.6::baseos | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-subid-debuginfo` | Red Hat:rhel_eus:8.6::baseos | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-debuginfo` | Red Hat:rhel_eus:8.6::crb | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-debugsource` | Red Hat:rhel_eus:8.6::crb | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-subid-debuginfo` | Red Hat:rhel_eus:8.6::crb | All versions | 2:4.6-17.el8_6 |
| `shadow-utils-subid-devel` | Red Hat:rhel_eus:8.6::crb | All versions | 2:4.6-17.el8_6 |
| `shadow-utils` | Red Hat:rhel_eus:8.8::baseos | All versions | 2:4.6-17.el8_8.2 |
| `shadow-utils-debuginfo` | Red Hat:rhel_eus:8.8::baseos | All versions | 2:4.6-17.el8_8.2 |
| `shadow-utils-debugsource` | Red Hat:rhel_eus:8.8::baseos | All versions | 2:4.6-17.el8_8.2 |
| `shadow-utils-subid` | Red Hat:rhel_eus:8.8::baseos | All versions | 2:4.6-17.el8_8.2 |
| `shadow-utils-subid-debuginfo` | Red Hat:rhel_eus:8.8::baseos | All versions | 2:4.6-17.el8_8.2 |
| `shadow-utils-debuginfo` | Red Hat:rhel_eus:8.8::crb | All versions | 2:4.6-17.el8_8.2 |
| `shadow-utils-debugsource` | Red Hat:rhel_eus:8.8::crb | All versions | 2:4.6-17.el8_8.2 |

Products: Redhat Codeready Linux Builder, Redhat Codeready Linux Builder for Arm64, Redhat Codeready Linux Builder for Ibm Z Systems, Redhat Codeready Linux Builder for Power Little Endian, Redhat Enterprise Linux, Redhat Enterprise Linux for Arm 64, Redhat Enterprise Linux for Ibm Z Systems, Redhat Enterprise Linux for Power Little Endian, Shadow-Maint Shadow-Utils.

## How do I fix CVE-2023-4641?

Apply the vendor's patch.

## Is CVE-2023-4641 being exploited?

There is no known exploitation of CVE-2023-4641 in the wild and no public exploit code.

## Other vulnerabilities in Redhat Enterprise Linux

- [CVE-2019-8720](https://insights.sbomify.com/CVE-2019-8720/): WebKitGTK Memory Corruption (high 8.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-4641 and fix it if it is affected.

What it is: CVE-2023-4641 is a medium-severity vulnerability in Redhat Enterprise Linux, published on 27 Dec 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-4641 in the wild and no public exploit code.

Affected product: Redhat Enterprise Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-4641/ (Markdown: https://insights.sbomify.com/CVE-2023-4641/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-4641
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-4641
- OSV: https://osv.dev/vulnerability/CVE-2023-4641

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-4641/
Summaries are generated and may contain mistakes; the official description above is the record.
