Apache Kafka Client: Arbitrary file read and SSRF vulnerability
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Apache Kafka Client allows arbitrary file read and SSRF via SASL/OAUTHBEARER endpoint URLs, exploitable when untrusted parties set client configurations.
Vulnerability
Overview
CVE-2025-27817 is an arbitrary file read and Server-Side Request Forgery (SSRF) vulnerability in Apache Kafka Client. The flaw resides in the SASL/OAUTHBEARER authentication mechanism, which accepts configuration parameters sasl.oauthbearer.token.endpoint.url and sasl.oauthbearer.jwks.endpoint.url. These URLs are used to fetch tokens or JWKS data, but the client does not validate the scheme or destination, allowing an attacker to specify file:// URIs or internal network addresses [2][3].
Exploitation
Prerequisites
Exploitation requires that an untrusted party can supply Kafka client configuration values. This is particularly relevant in Apache Kafka Connect, where the REST API may allow setting connector configurations that include these parameters. No additional authentication is needed if the configuration endpoint is exposed. An attacker can set the token endpoint URL to a local file (e.g., file:///etc/passwd) or an internal service (e.g., http://internal-service/) [3].
Impact
Successful exploitation enables reading arbitrary files from the Kafka client's filesystem, including environment variables, and making HTTP requests to unintended internal or external hosts. The file content is returned in error logs, while SSRF can be used to probe internal networks or access cloud metadata endpoints. In SaaS environments, this could lead to significant information disclosure and lateral movement [2][3].
Mitigation
Apache Kafka 3.9.1 and 4.0.0 introduce a system property -Dorg.apache.kafka.sasl.oauthbearer.allowed.urls to restrict permitted URLs. In 3.9.1, the default allows all URLs for backward compatibility; in 4.0.0 and later, the default is an empty list, requiring explicit configuration. Users should upgrade to a fixed version and set the allowed URLs to a safe list [2][3].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.apache.kafka:kafka-clientsMaven | >= 3.1.0, < 3.9.1 | 3.9.1 |
Affected products
3- Range: <=3.9.1
- Range: <=3.9.1
- Apache Software Foundation/Apache Kafka Clientv5Range: 3.1.0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-vgq5-3255-v292ghsaADVISORY
- kafka.apache.org/cve-listghsavendor-advisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2025-27817ghsaADVISORY
- www.openwall.com/lists/oss-security/2025/06/09/1ghsaWEB
News mentions
0No linked articles in our index yet.