# CVE-2021-3521: Security feature bypass in RPM

> RPM fails to verify OpenPGP subkey binding signatures, allowing attackers to bypass signature checks and install malicious packages if they compromise repositories or keys.

- **Severity:** Medium 4.7 (`CVSS:3.1/AV:L/AC:H/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:** 22 Aug 2022
- **Updated:** 3 Aug 2024
- **Also known as:** ALSA-2022:0368, AZL-10637, CLSA-2022-1644869406, CLSA-2026-1777539108, CLSA-2026-1777539405, CLSA-2026-1777545003, DEBIAN-CVE-2021-3521, GHSA-pr6x-p264-jrpq, MGASA-2022-0321, OESA-2021-1431, RHSA-2022:0254, RHSA-2022:0368, RHSA-2022:0634, RLSA-2022:0368, SUSE-SU-2024:1557-1, SUSE-SU-2024:1557-2, SUSE-SU-2024:1557-3, UBUNTU-CVE-2021-3521, openSUSE-SU-2024:12245-1

## What is CVE-2021-3521?

CVE-2021-3521 is a medium-severity vulnerability in RPM, published on 22 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

There is a flaw in RPM's signature functionality. OpenPGP subkeys are associated with a primary key via a "binding signature." RPM does not check the binding signature of subkeys prior to importing them. If an attacker is able to add or socially engineer another party to add a malicious subkey to a legitimate public key, RPM could wrongly trust a malicious signature. The greatest impact of this flaw is to data integrity. To exploit this flaw, an attacker must either compromise an RPM repository or convince an administrator to install an untrusted RPM or public key. It is strongly recommended to only use RPMs and public keys from trusted sources.

Weakness: CWE-347 (Improper Verification of Cryptographic Signature)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rpm-build` | AlmaLinux:8 | All versions | 4.14.3-19.el8_5.2 |
| `rpm-plugin-fapolicyd` | AlmaLinux:8 | All versions | 4.14.3-19.el8_5.2 |
| `python3-rpm-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-build` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-build-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-build-libs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-devel-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-libs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-fapolicyd` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-fapolicyd-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-ima-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-prioreset-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-selinux-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-syslog-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-systemd-inhibit-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-sign-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.14.3-19.el8_5.2 |
| `python3-rpm` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `python3-rpm-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-apidocs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-build-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-build-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-build-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-cron` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-devel` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-devel-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-libs` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-libs-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-fapolicyd-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-ima` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-ima-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-prioreset` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-prioreset-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-selinux` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-selinux-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |
| `rpm-plugin-syslog` | Red Hat:enterprise_linux:8::baseos | All versions | 0:4.14.3-19.el8_5.2 |

Products: Rpm Rpm.

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

Apply the vendor's patch.

## Is CVE-2021-3521 being exploited?

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

## Other vulnerabilities in RPM

- [CVE-2014-8118](https://insights.sbomify.com/CVE-2014-8118/): Integer overflow in n/a (critical 10.0)
- [CVE-2011-3378](https://insights.sbomify.com/CVE-2011-3378/): Memory corruption in n/a (critical 9.3)
- [CVE-2017-7501](https://insights.sbomify.com/CVE-2017-7501/): Path traversal in rpm (high 7.8)
- [CVE-2017-7500](https://insights.sbomify.com/CVE-2017-7500/): Path traversal in rpm (high 7.3)
- [CVE-2005-4889](https://insights.sbomify.com/CVE-2005-4889/): Race condition in n/a (high 7.2)

## Fix prompt for AI coding agents

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

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

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

## Sources

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

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