# CVE-2022-1304: Memory corruption in e2fsprogs

> Attackers can trigger arbitrary code execution or crashes in e2fsprogs by mounting a specially crafted filesystem.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Apr 2022
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2022-1304, ALSA-2022:7720, ALSA-2022:8361, AZL-9407, CLSA-2024-1711476689, DEBIAN-CVE-2022-1304, DLA-3910-1, GHSA-jrv4-gggm-r53c, MGASA-2022-0384, OESA-2022-1719, RHBA-2023:7393, RHSA-2022:7720, RHSA-2022:8361, RLSA-2022:7720, RLSA-2022:8361, SUSE-SU-2022:1652-1, SUSE-SU-2022:1688-1, SUSE-SU-2022:1695-1, SUSE-SU-2022:1718-1, UBUNTU-CVE-2022-1304, USN-5464-1

## What is CVE-2022-1304?

CVE-2022-1304 is a high-severity memory corruption vulnerability in Fedoraproject Fedora, published on 14 Apr 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

An out-of-bounds read/write vulnerability was found in e2fsprogs 1.46.5. This issue leads to a segmentation fault and possibly arbitrary code execution via a specially crafted filesystem.

Weakness: CWE-787 (Out-of-bounds Write), CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2022-1304?

It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `e2fsprogs` | AlmaLinux:8 | All versions | 1.45.6-5.el8 |
| `e2fsprogs-devel` | AlmaLinux:8 | All versions | 1.45.6-5.el8 |
| `e2fsprogs-libs` | AlmaLinux:8 | All versions | 1.45.6-5.el8 |
| `libcom_err` | AlmaLinux:8 | All versions | 1.45.6-5.el8 |
| `libcom_err-devel` | AlmaLinux:8 | All versions | 1.45.6-5.el8 |
| `libss` | AlmaLinux:8 | All versions | 1.45.6-5.el8 |
| `libss-devel` | AlmaLinux:8 | All versions | 1.45.6-5.el8 |
| `e2fsprogs` | AlmaLinux:9 | All versions | 1.46.5-3.el9 |
| `e2fsprogs-devel` | AlmaLinux:9 | All versions | 1.46.5-3.el9 |
| `e2fsprogs-libs` | AlmaLinux:9 | All versions | 1.46.5-3.el9 |
| `libcom_err` | AlmaLinux:9 | All versions | 1.46.5-3.el9 |
| `libcom_err-devel` | AlmaLinux:9 | All versions | 1.46.5-3.el9 |
| `libss` | AlmaLinux:9 | All versions | 1.46.5-3.el9 |
| `e2fsprogs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-devel` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `libcom_err` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `libcom_err-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `libcom_err-devel` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `libss` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `libss-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-debugsource` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-libs-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.45.6-5.el8 |
| `libcom_err-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.45.6-5.el8 |
| `libss-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.45.6-5.el8 |
| `libss-devel` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.45.6-5.el8 |
| `e2fsprogs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.46.5-3.el9 |
| `e2fsprogs-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.46.5-3.el9 |
| `e2fsprogs-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.46.5-3.el9 |
| `e2fsprogs-libs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.46.5-3.el9 |
| `libcom_err-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.46.5-3.el9 |
| `libcom_err-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.46.5-3.el9 |
| `libss-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.46.5-3.el9 |
| `e2fsprogs` | Red Hat:enterprise_linux:9::baseos | All versions | 0:1.46.5-3.el9 |
| `e2fsprogs-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:1.46.5-3.el9 |
| `e2fsprogs-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:1.46.5-3.el9 |

Products: E2fsprogs Project E2fsprogs, Fedoraproject Fedora, Redhat Enterprise Linux.

## How do I fix CVE-2022-1304?

Apply the vendor's patch.

## Is CVE-2022-1304 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-1304 and fix it if it is affected.

What it is: CVE-2022-1304 is a high-severity memory corruption vulnerability in Fedoraproject Fedora, published on 14 Apr 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-1304 in the wild and no public exploit code.

Affected product: Fedoraproject Fedora. 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-2022-1304/ (Markdown: https://insights.sbomify.com/CVE-2022-1304/index.md)
```

## Sources

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

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