Skip to main content

CVE-2025-27818: CWE-502 Deserialization of Untrusted Data in Apache Software Foundation Apache Kafka

High
VulnerabilityCVE-2025-27818cvecve-2025-27818cwe-502
Published: Tue Jun 10 2025 (06/10/2025, 07:52:31 UTC)
Source: CVE Database V5
Vendor/Project: Apache Software Foundation
Product: Apache Kafka

Description

A possible security vulnerability has been identified in Apache Kafka. This requires access to a alterConfig to the cluster resource, or Kafka Connect worker, and the ability to create/modify connectors on it with an arbitrary Kafka client SASL JAAS config and a SASL-based security protocol, which has been possible on Kafka clusters since Apache Kafka 2.0.0 (Kafka Connect 2.3.0). When configuring the broker via config file or AlterConfig command, or connector via the Kafka Kafka Connect REST API, an authenticated operator can set the `sasl.jaas.config` property for any of the connector's Kafka clients to "com.sun.security.auth.module.LdapLoginModule", which can be done via the `producer.override.sasl.jaas.config`, `consumer.override.sasl.jaas.config`, or `admin.override.sasl.jaas.config` properties. This will allow the server to connect to the attacker's LDAP server and deserialize the LDAP response, which the attacker can use to execute java deserialization gadget chains on the Kafka connect server. Attacker can cause unrestricted deserialization of untrusted data (or) RCE vulnerability when there are gadgets in the classpath. Since Apache Kafka 3.0.0, users are allowed to specify these properties in connector configurations for Kafka Connect clusters running with out-of-the-box configurations. Before Apache Kafka 3.0.0, users may not specify these properties unless the Kafka Connect cluster has been reconfigured with a connector client override policy that permits them. Since Apache Kafka 3.9.1/4.0.0, we have added a system property ("-Dorg.apache.kafka.disallowed.login.modules") to disable the problematic login modules usage in SASL JAAS configuration. Also by default "com.sun.security.auth.module.JndiLoginModule,com.sun.security.auth.module.LdapLoginModule" are disabled in Apache Kafka Connect 3.9.1/4.0.0. We advise the Kafka users to validate connector configurations and only allow trusted LDAP configurations. Also examine connector dependencies for vulnerable versions and either upgrade their connectors, upgrading that specific dependency, or removing the connectors as options for remediation. Finally, in addition to leveraging the "org.apache.kafka.disallowed.login.modules" system property, Kafka Connect users can also implement their own connector client config override policy, which can be used to control which Kafka client properties can be overridden directly in a connector config and which cannot.

AI-Powered Analysis

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

Technical Analysis

CVE-2025-27818 is a high-severity vulnerability affecting Apache Kafka, specifically related to the deserialization of untrusted data (CWE-502) within Kafka Connect components. The vulnerability arises when an authenticated operator with permissions to alter cluster configurations or create/modify connectors can set the 'sasl.jaas.config' property in Kafka client configurations to use the 'com.sun.security.auth.module.LdapLoginModule'. This configuration enables the Kafka Connect server to connect to an attacker-controlled LDAP server and deserialize malicious LDAP responses. If the classpath contains exploitable Java deserialization gadgets, this can lead to remote code execution (RCE) on the Kafka Connect server. The issue has existed since Kafka 2.0.0 (Kafka Connect 2.3.0) and is exacerbated by the ability since Kafka 3.0.0 to specify these properties in connector configurations without additional restrictions. Mitigations introduced in Kafka 3.9.1/4.0.0 include a system property to disable problematic login modules by default, specifically disabling 'JndiLoginModule' and 'LdapLoginModule'. Users are advised to validate connector configurations, restrict LDAP configurations to trusted sources, audit connector dependencies for vulnerable versions, and implement connector client config override policies to control which Kafka client properties can be overridden. This vulnerability requires authenticated access with specific privileges, does not require user interaction, and can lead to full compromise of Kafka Connect servers through RCE, impacting confidentiality, integrity, and availability of affected systems.

Potential Impact

For European organizations, the impact of this vulnerability can be significant, especially for those relying on Apache Kafka for critical data streaming and integration services. Successful exploitation could lead to full compromise of Kafka Connect servers, allowing attackers to execute arbitrary code, potentially leading to data exfiltration, disruption of data pipelines, and lateral movement within corporate networks. This can affect sectors such as finance, telecommunications, manufacturing, and public services, where Kafka is commonly used for real-time data processing. The breach of Kafka infrastructure could undermine trust in data integrity and availability, disrupt business operations, and cause regulatory compliance issues under GDPR due to potential data leaks. The requirement for authenticated access somewhat limits the attack surface but does not eliminate risk, as insider threats or compromised credentials could be leveraged. The ability to execute RCE remotely elevates the threat to critical infrastructure components, making timely mitigation essential.

Mitigation Recommendations

European organizations should implement a multi-layered mitigation approach: 1) Upgrade Apache Kafka to version 3.9.1 or later, where the problematic login modules are disabled by default via the 'org.apache.kafka.disallowed.login.modules' system property. 2) Audit and restrict connector configurations to disallow setting 'sasl.jaas.config' properties that reference untrusted LDAP login modules. 3) Implement strict connector client config override policies to control which Kafka client properties can be overridden in connector configurations, preventing unauthorized changes. 4) Conduct thorough dependency analysis on connectors to identify and upgrade or remove those with vulnerable versions or unsafe deserialization gadgets. 5) Enforce strong authentication and authorization controls to limit who can alter cluster configurations or create/modify connectors. 6) Monitor Kafka Connect logs and network traffic for unusual LDAP connections or configuration changes. 7) Employ network segmentation to isolate Kafka Connect servers from untrusted networks and LDAP servers. 8) Regularly review and update security policies to incorporate these controls and ensure compliance.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
apache
Date Reserved
2025-03-07T09:34:38.930Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68487f551b0bd07c3938a24c

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

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

Last updated: 8/6/2025, 6:43:14 PM

Views: 24

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