# CVE-2024-29887: Serverpod client accepts any certificate

> The Serverpod client library fails to validate TLS certificates, allowing attackers to perform man-in-the-middle attacks and intercept or modify encrypted traffic.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Mar 2024
- **Updated:** 27 Aug 2024
- **Also known as:** GHSA-h6x7-r5rg-x5fw

## What is CVE-2024-29887?

CVE-2024-29887 is a high-severity vulnerability in serverpod, published on 27 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Serverpod is an app and web server, built for the Flutter and Dart ecosystem. This bug bypassed the validation of TSL certificates on all none web HTTP clients in the `serverpod_client` package. Making them susceptible to a man in the middle attack against encrypted traffic between the client device and the server. An attacker would need to be able to intercept the traffic and highjack the connection to the server for this vulnerability to be used. Upgrading to version `1.2.6` resolves this issue.

Weakness: CWE-295 (Improper Certificate Validation)

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

2 open source packages ship an affected version, including serverpod_client. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `serverpod_client` | Pub | All versions | 1.2.6 |
| `serverpod_client` | Pub | All versions | 1.2.6 |

Products: Serverpod Serverpod.

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

Upgrade serverpod_client to 1.2.6 or later.

## Is CVE-2024-29887 being exploited?

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

## Other vulnerabilities in serverpod

- [CVE-2024-29886](https://insights.sbomify.com/CVE-2024-29886/): Improved security for stored password hashes (medium 5.3)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-29887 is a high-severity vulnerability in serverpod, published on 27 Mar 2024. 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-2024-29887 exists.

Affected packages and fixed versions:
- serverpod_client (Pub): affected all versions; fixed in 1.2.6
- serverpod_client (Pub): affected all versions; fixed in 1.2.6

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-29887/ (Markdown: https://insights.sbomify.com/CVE-2024-29887/index.md)
```

## Sources

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

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