Skip to main content

CVE-2025-27817: Arbitrary file read and SSRF vulnerability in Apache Software Foundation Apache Kafka Client

High
VulnerabilityCVE-2025-27817cvecve-2025-27817
Published: Tue Jun 10 2025 (06/10/2025, 07:55:14 UTC)
Source: CVE Database V5
Vendor/Project: Apache Software Foundation
Product: Apache Kafka Client

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-Powered Analysis

AILast updated: 07/11/2025, 00:18:45 UTC

Technical Analysis

CVE-2025-27817 is a high-severity vulnerability affecting the Apache Kafka Client, specifically related to its SASL/OAUTHBEARER authentication configuration. Apache Kafka Clients allow configuration of OAuth bearer token endpoints via parameters such as "sasl.oauthbearer.token.endpoint.url" and "sasl.oauthbearer.jwks.endpoint.url". Due to insufficient validation of these URLs, an attacker who can influence these configuration parameters can exploit this flaw to perform arbitrary file reads on the client system or conduct Server-Side Request Forgery (SSRF) attacks. The arbitrary file read occurs because the client may log error messages containing contents of files referenced by manipulated URLs, thus leaking sensitive data such as environment variables or configuration files. SSRF exploitation allows attackers to make requests to unintended internal or external network locations, potentially accessing internal services or exfiltrating data. This vulnerability is particularly critical in scenarios where Apache Kafka Clients are used in environments that accept configuration data from untrusted sources, such as Apache Kafka Connect REST APIs or SaaS platforms. The flaw enables privilege escalation from REST API access to filesystem and network access, which is typically restricted. Starting with Apache Kafka versions 3.9.1 and 4.0.0, a mitigation mechanism was introduced via the system property "-Dorg.apache.kafka.sasl.oauthbearer.allowed.urls" to restrict allowed URLs in SASL JAAS configuration. However, in version 3.9.1, the default setting allows all URLs for backward compatibility, while in 4.0.0 and later, the default is an empty list requiring explicit configuration. The vulnerability has a CVSS v3.1 score of 7.5, reflecting its high severity due to network attack vector, no required privileges or user interaction, and high impact on confidentiality. No known exploits are reported in the wild as of the publication date.

Potential Impact

For European organizations, this vulnerability poses significant risks, especially for enterprises leveraging Apache Kafka for critical data streaming and messaging services. The arbitrary file read capability can lead to leakage of sensitive configuration files, credentials, or environment variables, potentially exposing secrets that facilitate further compromise. SSRF attacks can be leveraged to pivot into internal networks, accessing internal services that are otherwise protected by perimeter defenses. This is particularly concerning for cloud-based or hybrid deployments common in Europe, where Kafka Connect REST APIs might be exposed or integrated with third-party SaaS solutions. The ability to escalate from REST API access to filesystem and network access could result in data breaches, disruption of services, or unauthorized access to internal resources. Given the widespread adoption of Apache Kafka in financial services, telecommunications, manufacturing, and public sector organizations across Europe, exploitation could have broad operational and reputational impacts. Additionally, compliance with GDPR and other data protection regulations means that data leaks resulting from this vulnerability could lead to regulatory penalties and loss of customer trust.

Mitigation Recommendations

European organizations should take the following specific actions to mitigate this vulnerability: 1) Upgrade Apache Kafka Clients to version 4.0.0 or later, where the default configuration for allowed OAuth bearer URLs is an empty list, enforcing explicit URL whitelisting. 2) If upgrading is not immediately feasible, configure the system property "-Dorg.apache.kafka.sasl.oauthbearer.allowed.urls" to explicitly whitelist only trusted and necessary URLs, thereby preventing arbitrary URL usage. 3) Audit all Kafka Client configurations, especially those exposed to untrusted sources such as REST APIs or multi-tenant SaaS environments, to ensure that OAuth bearer token endpoint URLs cannot be manipulated by attackers. 4) Implement strict access controls and authentication on Kafka Connect REST APIs to limit configuration changes to authorized personnel only. 5) Monitor Kafka client logs and network traffic for unusual requests or error messages that might indicate exploitation attempts. 6) Conduct penetration testing and code reviews focusing on SASL/OAUTHBEARER configurations to identify and remediate potential injection points. 7) Employ network segmentation and firewall rules to restrict outbound requests from Kafka clients to only trusted endpoints, limiting SSRF impact. 8) Maintain an incident response plan that includes this vulnerability to rapidly detect and respond to exploitation attempts.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
apache
Date Reserved
2025-03-07T08:12:18.582Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68487f551b0bd07c3938a248

Added to database: 6/10/2025, 6:54:13 PM

Last enriched: 7/11/2025, 12:18:45 AM

Last updated: 7/16/2025, 7:06:14 AM

Views: 20

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats