CVE-2025-27818
High · 8.8Apache Kafka Deserialization of Untrusted Data vulnerability
CVSS
8.8
EPSS
1.1%
Published
Jun 10, 2025
CISA due date
—
Cloudanix analysis
A configuration feature in Kafka Connect can be abused by someone who already has permission to change settings, allowing them to run arbitrary code on the servers that move data in and out of Kafka.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Remote Code Execution
- Component
- Application
- Class
- Deserialization
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Authenticated users with alterConfig access can set connector client SASL JAAS overrides to com.sun.security.auth.module.LdapLoginModule, causing the Kafka Connect worker to connect to an attacker-controlled LDAP server and deserialize the response, enabling arbitrary Java deserialization gadget chains and potential RCE when gadgets are present in the classpath.
Why it matters to the business
Attackers with limited cluster privileges can achieve remote code execution on Kafka Connect workers, leading to potential cluster compromise, data exfiltration, or service disruption; the issue affects clusters since Kafka 2.0.0 / Connect 2.3.0 and is more easily triggered on versions 3.0.0 and later without custom policies.
How an attack unfolds
An attacker with alterConfig rights on the cluster or Connect worker creates or modifies a connector, supplying producer/consumer/admin override properties that set sasl.jaas.config to LdapLoginModule pointing at a malicious LDAP server; the server then returns a serialized object that triggers deserialization gadgets on the Connect worker, resulting in code execution.
How to fix it
Upgrade to Apache Kafka 3.9.1 or 4.0.0 (or later) where LdapLoginModule and JndiLoginModule are disabled by default via the org.apache.kafka.disallowed.login.modules system property; implement a custom connector client override policy to block the three override.sasl.jaas.config properties; validate all existing connector configurations and remove or replace any using untrusted LDAP settings; examine and upgrade connector dependencies that may contain deserialization gadgets.
How to confirm the fix worked
Confirm the disallowed.login.modules system property is set and contains com.sun.security.auth.module.LdapLoginModule; audit connector configurations via the REST API for any occurrence of the three override.sasl.jaas.config properties or the LdapLoginModule class name; verify that a connector client override policy is active and rejects these properties.
Typical attack path
- Obtain alterConfig privileges on the Kafka cluster or Connect worker
- Create or update a connector via the REST API supplying producer.override.sasl.jaas.config (or consumer/admin equivalents) that references com.sun.security.auth.module.LdapLoginModule against an attacker LDAP endpoint
- Trigger connector task startup so the worker performs the LDAP bind and deserializes the malicious response
- Execute gadget chain to achieve RCE on the Connect worker
How to detect it
Search Kafka Connect worker logs and connector configuration history for the strings producer.override.sasl.jaas.config, consumer.override.sasl.jaas.config, admin.override.sasl.jaas.config or com.sun.security.auth.module.LdapLoginModule; review audit logs for recent connector creations or updates performed by non-admin identities; inspect heap dumps or process command lines for the disallowed.login.modules property on running workers.
- producer.override.sasl.jaas.config
- consumer.override.sasl.jaas.config
- admin.override.sasl.jaas.config
- com.sun.security.auth.module.LdapLoginModule
- org.apache.kafka.disallowed.login.modules
What your security team should do
- Immediately upgrade all Kafka Connect clusters to 3.9.1/4.0.0 or later
- Deploy a connector client override policy that blocks sasl.jaas.config overrides
- Scan existing connectors for LdapLoginModule or JndiLoginModule usage and remediate
- Review alterConfig role assignments and apply least privilege
- Monitor for new connector creations that include the three override properties
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Maven | org.apache.kafka:kafka | 2.3.0 | 3.9.1 |
| Maven | org.apache.kafka:kafka_2.11 | 2.3.0 | No fix |
| Maven | org.apache.kafka:kafka_2.12 | 2.3.0 | 3.9.1 |
| Maven | org.apache.kafka:kafka_2.13 | 2.4.0 | 3.9.1 |
| Bitnami | kafka | 2.3.0 | 3.9.1 |
| maven | org.apache.kafka/kafka | 2.3.0 | 3.9.1 |
| maven | org.apache.kafka/kafka_2.11 | 2.3.0 | No fix |
| maven | org.apache.kafka/kafka_2.12 | 2.3.0 | 3.9.1 |
| maven | org.apache.kafka/kafka_2.13 | 2.4.0 | 3.9.1 |
Related vulnerabilities
- CVE-2025-27819 Apache Kafka Deserialization of Untrusted Data vulnerability Also affects org.apache.kafka:kafka
- CVE-2024-56128 Apache Kafka's SCRAM implementation Incorrectly Implements Authentication Algorithm Also affects org.apache.kafka:kafka
- CVE-2025-27817 Apache Kafka Client Arbitrary File Read and Server Side Request Forgery Vulnerability Also affects kafka
- CVE-2024-27309 While an Apache Kafka cluster is being migrated from ZooKeeper mode to KRaft mode, in… Also affects kafka
- CVE-2023-25194 A possible security vulnerability has been identified in Apache Kafka Connect API. Also affects org.apache.kafka/kafka
- CVE-2026-63393 OpenSearch SQL supports querying OpenSearch data using SQL and Piped Processing Language. CWE-502
- CVE-2026-118938 In Trail of Bits fickling through 0.1.12, a pickle STACK_GLOBAL operand carrying a dotted… CWE-502
- CVE-2026-16760 In Trail of Bits fickling through 0.1.12, the _process_import() method in fickle.py adds… CWE-502