# CVE-2021-4122: Security feature bypass in cryptsetup

> An attacker with physical access can craft a LUKS header to force cryptsetup to disable encryption, bypassing data protection on the medium.

- **Severity:** Medium 4.3 (`CVSS:3.1/AV:P/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`)
- **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:** 24 Aug 2022
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2021-4122, ALSA-2022:0370, CLSA-2022-1643914390, CLSA-2022-1643917881, DEBIAN-CVE-2021-4122, DSA-5070-1, GHSA-8fgw-wvm8-3x84, MGASA-2022-0047, OESA-2022-1532, RHSA-2022:0370, RLSA-2022:0370, SUSE-SU-2022:0144-1, UBUNTU-CVE-2021-4122, USN-5286-1, openSUSE-SU-2022:0144-1, openSUSE-SU-2024:11754-1

## What is CVE-2021-4122?

CVE-2021-4122 is a medium-severity vulnerability in cryptsetup, published on 24 Aug 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

It was found that a specially crafted LUKS header could trick cryptsetup into disabling encryption during the recovery of the device. An attacker with physical access to the medium, such as a flash disk, could use this flaw to force a user into permanently disabling the encryption layer of that medium.

Weakness: CWE-345 (Insufficient Verification of Data Authenticity)

## Which versions are affected by CVE-2021-4122?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cryptsetup-devel` | AlmaLinux:8 | All versions | 2.3.3-4.el8_5.1 |
| `cryptsetup-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-libs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-reencrypt-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.3.3-4.el8_5.1 |
| `integritysetup-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.3.3-4.el8_5.1 |
| `veritysetup-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-reencrypt` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup-reencrypt-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `integritysetup` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `integritysetup-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `veritysetup` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `veritysetup-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup` | Rocky Linux:8 | All versions | 0:2.3.3-4.el8_5.1 |
| `cryptsetup` | SUSE:Linux Enterprise Micro 5.1 | All versions | 2.3.7-150300.3.5.1 |
| `cryptsetup` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 2.3.7-150300.3.5.1 |
| `varnish` | SUSE:Package Hub 15 SP4 | All versions | 7.1.0-bp154.2.3.1 |
| `cryptsetup` | openSUSE:Leap 15.3 | All versions | 2.3.7-150300.3.5.1 |
| `varnish` | openSUSE:Leap 15.4 | All versions | 7.1.0-bp154.2.3.1 |
| `cryptsetup` | openSUSE:Tumbleweed | All versions | 2.4.3-1.1 |

Products: Cryptsetup Project Cryptsetup.

## How do I fix CVE-2021-4122?

Apply the vendor's patch.

## Is CVE-2021-4122 being exploited?

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

## Other vulnerabilities in cryptsetup

- [CVE-2016-4484](https://insights.sbomify.com/CVE-2016-4484/): Auth bypass in n/a (medium 6.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-4122 and fix it if it is affected.

What it is: CVE-2021-4122 is a medium-severity vulnerability in cryptsetup, published on 24 Aug 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-2021-4122 in the wild and no public exploit code.

Affected product: cryptsetup. 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-2021-4122/ (Markdown: https://insights.sbomify.com/CVE-2021-4122/index.md)
```

## Sources

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

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