# CVE-2024-51504: Apache ZooKeeper: Authentication bypass with IP-based authentication in Admin Server

> Attackers can bypass IP-based authentication in ZooKeeper Admin Server by spoofing X-Forwarded-For headers, enabling unauthorized command execution and data access.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/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:** 7 Nov 2024
- **Updated:** 7 Nov 2024
- **Also known as:** BIT-zookeeper-2024-51504, DEBIAN-CVE-2024-51504, GHSA-g93m-8x6h-g5gv, MINI-65f5-v3qq-7f7r, OESA-2024-2600, ROOT-APP-MAVEN-CVE-2024-51504, UBUNTU-CVE-2024-51504

## What is CVE-2024-51504?

CVE-2024-51504 is a critical authentication bypass vulnerability in Apache ZooKeeper, published on 7 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

When using IPAuthenticationProvider in ZooKeeper Admin Server there is a possibility of Authentication Bypass by Spoofing -- this only impacts IP based authentication implemented in ZooKeeper Admin Server. Default configuration of client's IP address detection in IPAuthenticationProvider, which uses HTTP request headers, is weak and allows an attacker to bypass authentication via spoofing client's IP address in request headers. Default configuration honors X-Forwarded-For HTTP header to read client's IP address. X-Forwarded-For request header is mainly used by proxy servers to identify the client and can be easily spoofed by an attacker pretending that the request comes from a different IP address. Admin Server commands, such as snapshot and restore arbitrarily can be executed on successful exploitation which could potentially lead to information leakage or service availability issues. Users are recommended to upgrade to version 3.9.3, which fixes this issue.

Weakness: CWE-290 (Authentication Bypass by Spoofing)

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

3 open source packages ship an affected version, including org.apache.zookeeper:zookeeper and zookeeper. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.zookeeper:zookeeper` | Maven | From 3.9.0 | 3.9.3 |
| `org.apache.zookeeper:zookeeper` | Maven | From 3.9.0 | 3.9.3 |
| `zookeeper` | Bitnami | From 3.9.0 | 3.9.3 |

Products: Apache Zookeeper.

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

Upgrade org.apache.zookeeper:zookeeper to 3.9.3 or later.

## Is CVE-2024-51504 being exploited?

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

## Other vulnerabilities in Apache ZooKeeper

- [CVE-2023-44981](https://insights.sbomify.com/CVE-2023-44981/): Apache ZooKeeper: Authorization bypass in SASL Quorum Peer Authentication (critical 9.1)
- [CVE-2016-5017](https://insights.sbomify.com/CVE-2016-5017/): Memory corruption in n/a (high 8.1)
- [CVE-2026-59739](https://insights.sbomify.com/CVE-2026-59739/): Apache ZooKeeper: Information disclosure via SetWatches reconnect replay (high 7.5)
- [CVE-2026-59969](https://insights.sbomify.com/CVE-2026-59969/): Apache ZooKeeper: Improper validation of certificate with host mismatch in FIPS mode (high 7.5)
- [CVE-2026-79993](https://insights.sbomify.com/CVE-2026-79993/): Missing authorization in Apache ZooKeeper (high 7.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-51504 is a critical authentication bypass vulnerability in Apache ZooKeeper, published on 7 Nov 2024. 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-2024-51504 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.zookeeper:zookeeper (Maven): affected from 3.9.0; fixed in 3.9.3
- org.apache.zookeeper:zookeeper (Maven): affected from 3.9.0; fixed in 3.9.3
- zookeeper (Bitnami): affected from 3.9.0; fixed in 3.9.3

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

## Sources

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

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