# CVE-2024-2357: IKEv2 misconfiguration can cause libreswan to abort and restart

> Attackers can cause repeated crashes and restarts in Libreswan by exploiting IKEv2 retransmit scenarios with specific PreSharedKey configurations.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 11 Mar 2024
- **Updated:** 13 Feb 2025
- **Also known as:** ALSA-2024:1998, ALSA-2024:2033, ALSA-2024:2565, AZL-35885, CLSA-2025-1764957598, DEBIAN-CVE-2024-2357, GHSA-77h7-8788-mfv3, MGASA-2024-0113, OESA-2024-1341, OESA-2024-1409, RHSA-2024:1998, RHSA-2024:2033, RHSA-2024:2081, RHSA-2024:2082, RHSA-2024:2085, RHSA-2024:2565, RLSA-2024:1998, RLSA-2024:2565, UBUNTU-CVE-2024-2357

## What is CVE-2024-2357?

CVE-2024-2357 is a medium-severity denial of service vulnerability in The Libreswan Project (www.libreswan.org) libreswan, published on 11 Mar 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

The Libreswan Project was notified of an issue causing libreswan to restart under some IKEv2 retransmit scenarios when a connection is configured to use PreSharedKeys (authby=secret) and the connection cannot find a matching configured secret. When such a connection is automatically added on startup using the auto= keyword, it can cause repeated crashes leading to a Denial of Service.

## Which versions are affected by CVE-2024-2357?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libreswan` | AlmaLinux:8 | All versions | 4.12-2.el8_9.2.alma.1 |
| `libreswan` | AlmaLinux:9 | All versions | 4.12-1.el9_3.1.alma.1 |
| `libreswan` | AlmaLinux:9 | All versions | 4.12-2.el9_4.alma.1 |
| `libreswan` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.12-2.el8_9.2 |
| `libreswan-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.12-2.el8_9.2 |
| `libreswan-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:4.12-2.el8_9.2 |
| `libreswan` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.12-1.el9_3.1 |
| `libreswan` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.12-2.el9_4 |
| `libreswan-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.12-1.el9_3.1 |
| `libreswan-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.12-2.el9_4 |
| `libreswan-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.12-1.el9_3.1 |
| `libreswan-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:4.12-2.el9_4 |
| `libreswan` | Red Hat:rhel_eus:8.6::appstream | All versions | 0:4.5-1.el8_6.2 |
| `libreswan-debuginfo` | Red Hat:rhel_eus:8.6::appstream | All versions | 0:4.5-1.el8_6.2 |
| `libreswan-debugsource` | Red Hat:rhel_eus:8.6::appstream | All versions | 0:4.5-1.el8_6.2 |
| `libreswan` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:4.9-3.el8_8.1 |
| `libreswan-debuginfo` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:4.9-3.el8_8.1 |
| `libreswan-debugsource` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:4.9-3.el8_8.1 |
| `libreswan` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:4.9-5.el9_2.1 |
| `libreswan-debuginfo` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:4.9-5.el9_2.1 |
| `libreswan-debugsource` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:4.9-5.el9_2.1 |
| `libreswan` | Rocky Linux:8 | All versions | 0:4.12-2.el8_9.2 |
| `libreswan` | Rocky Linux:9 | All versions | 0:4.12-2.el9_4 |

## How do I fix CVE-2024-2357?

Apply the vendor's patch.

## Is CVE-2024-2357 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-2357 and fix it if it is affected.

What it is: CVE-2024-2357 is a medium-severity denial of service vulnerability in The Libreswan Project (www.libreswan.org) libreswan, published on 11 Mar 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-2357 in the wild and no public exploit code.

Affected product: The Libreswan Project (www.libreswan.org) libreswan. 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-2024-2357/ (Markdown: https://insights.sbomify.com/CVE-2024-2357/index.md)
```

## Sources

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

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