# CVE-2025-27817: Apache Kafka Client: Arbitrary file read and SSRF vulnerability

> Attackers with control over Kafka client configurations can read arbitrary files or trigger SSRF via SASL OAuthBearer endpoints, impacting applications allowing untrusted config input.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/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:** 10 Jun 2025
- **Updated:** 10 Jun 2025
- **Also known as:** BIT-kafka-2025-27817, CLEANSTART-2026-BG00340, CLEANSTART-2026-DH52252, CLSA-2026-1789425652, ECHO-dd90-8305-7f06, GHSA-vgq5-3255-v292, MINI-67gf-hhw2-52rc, MINI-6fx5-m978-9737, MINI-c4wf-9wc5-wfq8, MINI-cj6j-wv2r-8j3w, MINI-jmqm-3xgr-cmvm, MINI-p6pj-79xr-qfc6, MINI-qx7v-246x-pf3m, MINI-v2j4-43m9-jcmc, MINI-w6m4-pr78-g878, ROOT-APP-MAVEN-CVE-2025-27817

## What is CVE-2025-27817?

CVE-2025-27817 is a high-severity server-side request forgery vulnerability in Apache Kafka Client, published on 10 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A possible arbitrary file read and SSRF vulnerability has been identified in Apache Kafka Client. Apache Kafka Clients accept configuration data for setting the SASL/OAUTHBEARER connection with the brokers, including "sasl.oauthbearer.token.endpoint.url" and "sasl.oauthbearer.jwks.endpoint.url". Apache Kafka allows clients to read an arbitrary file and return the content in the error log, or sending requests to an unintended location. In applications where Apache Kafka Clients configurations can be specified by an untrusted party, attackers may use the "sasl.oauthbearer.token.endpoint.url" and "sasl.oauthbearer.jwks.endpoint.url" configuratin to read arbitrary contents of the disk and environment variables or make requests to an unintended location. In particular, this flaw may be used in Apache Kafka Connect to escalate from REST API access to filesystem/environment/URL access, which may be undesirable in certain environments, including SaaS products. 

Since Apache Kafka 3.9.1/4.0.0, we have added a system property ("-Dorg.apache.kafka.sasl.oauthbearer.allowed.urls") to set the allowed urls in SASL JAAS configuration. In 3.9.1, it accepts all urls by default for backward compatibility. However in 4.0.0 and newer, the default value is empty list and users have to set the allowed urls explicitly.

Weakness: CWE-918 (Server-Side Request Forgery)

## Which versions are affected by CVE-2025-27817?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.kafka:kafka-clients` | Maven | From 3.1.0 | 3.9.1 |
| `org.apache.kafka:kafka-clients` | Maven | From 3.1.0 | 3.9.1 |
| `kafka` | Bitnami | From 3.1.0 | 3.9.1 |

Products: Apache Kafka.

## How do I fix CVE-2025-27817?

Upgrade org.apache.kafka:kafka-clients to 3.9.1 or later.

## Is CVE-2025-27817 being exploited?

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

Public exploit code:

- Apache Kafka客户端未对用户输入进行严格验证和限制，未经身份验证的攻击者可通过构造恶意配置读取环境变量或磁盘任意内容，或向非预期位置发送请求，提升REST API的文件系统/环境/URL访问权限。 (github_poc): https://github.com/iSee857/CVE-2025-27817
- Apache Kafka 4.1.0 (KRaft) with Keycloak OAuth2 authentication using Strimzi - bypasses CVE-2025-27817 URL allowlist restriction (github_poc): https://github.com/oriolrius/kafka-keycloak-oauth
- Apache Kafka Client - Arbitrary File Read (nuclei): http/cves/2025/CVE-2025-27817.yaml

## Other vulnerabilities in Apache Kafka Client

- [CVE-2026-33557](https://insights.sbomify.com/CVE-2026-33557/): Apache Kafka: Missing JWT token validation in OAUTHBEARER authentication (critical 9.1)
- [CVE-2025-27818](https://insights.sbomify.com/CVE-2025-27818/): Apache Kafka: Possible RCE attack via SASL JAAS LdapLoginModule configuration (high 8.8)
- [CVE-2018-17196](https://insights.sbomify.com/CVE-2018-17196/): Improper Input Validation in Apache Kafka (high 8.8)
- [CVE-2026-35554](https://insights.sbomify.com/CVE-2026-35554/): Apache Kafka Clients: Kafka Producer Message Corruption and Misrouting via Buffer Pool Race Condition (high 8.7)
- [CVE-2025-27819](https://insights.sbomify.com/CVE-2025-27819/): Apache Kafka: Possible RCE/Denial of service attack via SASL JAAS JndiLoginModule configuration (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-27817 and fix it if it is affected.

What it is: CVE-2025-27817 is a high-severity server-side request forgery vulnerability in Apache Kafka Client, published on 10 Jun 2025. 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-2025-27817 exists.

Affected packages and fixed versions:
- org.apache.kafka:kafka-clients (Maven): affected from 3.1.0; fixed in 3.9.1
- org.apache.kafka:kafka-clients (Maven): affected from 3.1.0; fixed in 3.9.1
- kafka (Bitnami): affected from 3.1.0; fixed in 3.9.1

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

## Sources

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

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