# CVE-2022-3515: Integer overflow in libksba

> Remote attackers can execute arbitrary code on target systems by sending specially crafted data, such as malicious S/MIME attachments, to applications using Libksba.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Jan 2023
- **Updated:** 8 Apr 2025
- **Also known as:** ALPINE-CVE-2022-3515, ALSA-2022:7089, ALSA-2022:7090, AZL-13005, DEBIAN-CVE-2022-3515, DLA-3153-1, DSA-5255-1, GHSA-58wq-p76f-6qjh, JLSEC-2025-93, MGASA-2022-0404, OESA-2022-2021, RHSA-2022:7088, RHSA-2022:7089, RHSA-2022:7090, RHSA-2022:7209, RHSA-2022:7283, RHSA-2022:7927, RLSA-2022:7089, RLSA-2022:7090, SUSE-SU-2022:3681-1, SUSE-SU-2022:3683-1, UBUNTU-CVE-2022-3515, USN-5688-1, openSUSE-SU-2024:12418-1

## What is CVE-2022-3515?

CVE-2022-3515 is a critical vulnerability in libksba, published on 12 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A vulnerability was found in the Libksba library due to an integer overflow within the CRL parser. The vulnerability can be exploited remotely for code execution on the target system by passing specially crafted data to the application, for example, a malicious S/MIME attachment.

Weakness: CWE-190 (Integer Overflow or Wraparound)

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

It affects 4 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libksba` | AlmaLinux:8 | All versions | 1.3.5-8.el8_6 |
| `libksba-devel` | AlmaLinux:8 | All versions | 1.3.5-8.el8_6 |
| `libksba` | AlmaLinux:9 | All versions | 1.5.1-5.el9_0 |
| `libksba-devel` | AlmaLinux:9 | All versions | 1.5.1-5.el9_0 |
| `libksba` | Red Hat:enterprise_linux:7::client | All versions | 0:1.3.0-6.el7_9 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:1.3.0-6.el7_9 |
| `libksba-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:1.3.0-6.el7_9 |
| `libksba` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.3.0-6.el7_9 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.3.0-6.el7_9 |
| `libksba-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.3.0-6.el7_9 |
| `libksba` | Red Hat:enterprise_linux:7::server | All versions | 0:1.3.0-6.el7_9 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:7::server | All versions | 0:1.3.0-6.el7_9 |
| `libksba-devel` | Red Hat:enterprise_linux:7::server | All versions | 0:1.3.0-6.el7_9 |
| `libksba` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.3.0-6.el7_9 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.3.0-6.el7_9 |
| `libksba-devel` | Red Hat:enterprise_linux:7::workstation | All versions | 0:1.3.0-6.el7_9 |
| `libksba` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.3.5-8.el8_6 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.3.5-8.el8_6 |
| `libksba-debugsource` | Red Hat:enterprise_linux:8::baseos | All versions | 0:1.3.5-8.el8_6 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.3.5-8.el8_6 |
| `libksba-debugsource` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.3.5-8.el8_6 |
| `libksba-devel` | Red Hat:enterprise_linux:8::crb | All versions | 0:1.3.5-8.el8_6 |
| `libksba` | Red Hat:enterprise_linux:9::baseos | All versions | 0:1.5.1-5.el9_0 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:1.5.1-5.el9_0 |
| `libksba-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:1.5.1-5.el9_0 |
| `libksba-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:1.5.1-5.el9_0 |
| `libksba-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:1.5.1-5.el9_0 |
| `libksba-devel` | Red Hat:enterprise_linux:9::crb | All versions | 0:1.5.1-5.el9_0 |
| `libksba` | Red Hat:rhel_aus:8.2::baseos | All versions | 0:1.3.5-8.el8_2 |
| `libksba-debuginfo` | Red Hat:rhel_aus:8.2::baseos | All versions | 0:1.3.5-8.el8_2 |
| `libksba-debugsource` | Red Hat:rhel_aus:8.2::baseos | All versions | 0:1.3.5-8.el8_2 |
| `libksba` | Red Hat:rhel_e4s:8.1::baseos | All versions | 0:1.3.5-8.el8_1 |
| `libksba-debuginfo` | Red Hat:rhel_e4s:8.1::baseos | All versions | 0:1.3.5-8.el8_1 |
| `libksba-debugsource` | Red Hat:rhel_e4s:8.1::baseos | All versions | 0:1.3.5-8.el8_1 |
| `libksba` | Red Hat:rhel_e4s:8.2::baseos | All versions | 0:1.3.5-8.el8_2 |
| `libksba-debuginfo` | Red Hat:rhel_e4s:8.2::baseos | All versions | 0:1.3.5-8.el8_2 |
| `libksba-debugsource` | Red Hat:rhel_e4s:8.2::baseos | All versions | 0:1.3.5-8.el8_2 |
| `libksba` | Red Hat:rhel_eus:8.4::baseos | All versions | 0:1.3.5-8.el8_4 |
| `libksba-debuginfo` | Red Hat:rhel_eus:8.4::baseos | All versions | 0:1.3.5-8.el8_4 |
| `libksba-debugsource` | Red Hat:rhel_eus:8.4::baseos | All versions | 0:1.3.5-8.el8_4 |

Products: Gnupg Gnupg, Gnupg Libksba, Gnupg Vs-Desktop, Gpg4win Gpg4win.

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

Upgrade to a fixed version.

## Is CVE-2022-3515 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-3515 exists.

## Other vulnerabilities in libksba

- [CVE-2008-1530](https://insights.sbomify.com/CVE-2008-1530/): Memory corruption in n/a (critical 9.3)
- [CVE-2026-24882](https://insights.sbomify.com/CVE-2026-24882/): Memory corruption in GnuPG (high 8.4)
- [CVE-2026-24881](https://insights.sbomify.com/CVE-2026-24881/): Memory corruption in GnuPG (high 8.1)
- [CVE-2025-68973](https://insights.sbomify.com/CVE-2025-68973/): Memory corruption in GnuPG (high 7.8)
- [CVE-2020-25125](https://insights.sbomify.com/CVE-2020-25125/): Memory corruption in n/a (high 7.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2022-3515 is a critical vulnerability in libksba, published on 12 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-3515 exists.

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

## Sources

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

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