# CVE-2023-2295: Denial of service in libreswan

> A remote attacker can crash the libreswan pluto daemon by sending crafted IKEv1 packets, causing a denial of service.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/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:** 17 May 2023
- **Updated:** 22 Jan 2025
- **Also known as:** GHSA-gcrh-c42h-m2vw, RHSA-2023:3107, RHSA-2023:3148, RLSA-2023:3107, UBUNTU-CVE-2023-2295

## What is CVE-2023-2295?

CVE-2023-2295 is a high-severity denial of service vulnerability in Redhat Enterprise Linux, published on 17 May 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 libreswan library. This security issue occurs when an IKEv1 Aggressive Mode packet is received with only unacceptable crypto algorithms, and the response packet is not sent with a zero responder SPI. When a subsequent packet is received where the sender reuses the libreswan responder SPI as its own initiator SPI, the pluto daemon state machine crashes. No remote code execution is possible. This CVE exists because of a CVE-2023-30570 security regression for libreswan package in Red Hat Enterprise Linux 8.8 and Red Hat Enterprise Linux 9.2.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

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

It affects 5 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libreswan` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.9-3.el8_8 |
| `libreswan-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.9-3.el8_8 |
| `libreswan-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.9-3.el8_8 |
| `libreswan` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.9-4.el9_2 |
| `libreswan-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.9-4.el9_2 |
| `libreswan-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.9-4.el9_2 |
| `libreswan` | Rocky Linux:8 | All versions | 0:4.9-3.el8_8 |

Products: Libreswan Libreswan, Redhat Enterprise Linux, Redhat Enterprise Linux Eus, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server Tus.

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

Apply the vendor's patch.

## Is CVE-2023-2295 being exploited?

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

## Other vulnerabilities in Redhat Enterprise Linux

- [CVE-2013-7283](https://insights.sbomify.com/CVE-2013-7283/): Race condition in n/a (critical 9.3)
- [CVE-2026-12413](https://insights.sbomify.com/CVE-2026-12413/): IKEv2 Denial of Service via malformed fragmentation (high 7.5)
- [CVE-2026-50721](https://insights.sbomify.com/CVE-2026-50721/): IKEv1 Denial of Service via RSA-SHA1 (PKCS#1 Version 1.5 Encrypted) authentication payload (high 7.5)
- [CVE-2026-50722](https://insights.sbomify.com/CVE-2026-50722/): IKEv2 Denial of Service via RSA-SHA1 (PKCS#1 RSASSA-PKCS1-v1_5) authentication payload (high 7.5)
- [CVE-2023-30570](https://insights.sbomify.com/CVE-2023-30570/): Denial of service in n/a (high 7.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2023-2295 is a high-severity denial of service vulnerability in Redhat Enterprise Linux, published on 17 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-2295 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-2295/ (Markdown: https://insights.sbomify.com/CVE-2023-2295/index.md)
```

## Sources

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

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