CVE-2023-25194
Published: 07 February 2023
Summary
CVE-2023-25194 is a high-severity Deserialization of Untrusted Data (CWE-502) vulnerability in Apache Kafka Connect. Its CVSS base score is 8.8 (High).
Operationally, ranked in the top 0.1% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.
Deeper analysis
CVE-2023-25194 affects the Apache Kafka Connect API in clusters running Apache Kafka 2.3.0 and later. An authenticated user who can create or modify connectors is able to supply arbitrary SASL JAAS configuration through the producer.override.sasl.jaas.config, consumer.override.sasl.jaas.config, or admin.override.sasl.jaas.config properties. Setting sasl.jaas.config to com.sun.security.auth.module.JndiLoginModule causes the Kafka Connect worker to perform a JNDI lookup against an attacker-controlled LDAP server, resulting in deserialization of untrusted data and potential remote code execution when applicable gadget chains are present on the classpath. The issue became exploitable by default for out-of-the-box configurations starting with Kafka 3.0.0.
An attacker with access to a Kafka Connect REST endpoint can therefore achieve code execution on the worker nodes by returning a malicious LDAP response that triggers Java deserialization. The attack requires only low-privileged authenticated access and does not depend on user interaction or special network positioning beyond the ability to reach the Connect API.
Apache Kafka 3.4.0 introduced the org.apache.kafka.disallowed.login.modules system property, which disables JndiLoginModule by default, and recommends that operators implement a custom connector client override policy to restrict which client properties may be supplied in connector configurations. Additional guidance advises validating all connector settings, auditing connector dependencies for vulnerable versions, and upgrading or removing affected connectors. The associated EPSS score has reached a peak of 0.9607.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2023-0598
Vulnerability details
A possible security vulnerability has been identified in Apache Kafka Connect API. This requires access to a 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…
more
protocol, which has been possible on Kafka Connect clusters since Apache Kafka Connect 2.3.0. When configuring the connector via the 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.JndiLoginModule", 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.4.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" is disabled in Apache Kafka Connect 3.4.0. We advise the Kafka Connect users to validate connector configurations and only allow trusted JNDI 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.
- CWE(s)
Related Threats
No named actor attribution yet. ATT&CK technique mapping in progress for this CVE.
Affected Assets
Mitigating Controls
Likely Mitigating Controls AI
Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.
Penetration testing supplies malicious serialized objects, detecting unsafe deserialization and supporting corrective actions.
Evaluation of untrusted data handling (deserialization testing) reveals unsafe processing, which the required remediation process addresses.
Untrusted serialized data can be deserialized and observed inside the chamber, blocking gadget-chain exploitation outside the sandbox.
Validates or rejects untrusted serialized data before deserialization occurs.
Identifies and blocks malicious code introduced through deserialization of untrusted data at system boundaries.
Integrity verification of serialized information can detect tampering before deserialization occurs.
Provenance of associated data allows detection of untrusted sources before deserialization or processing occurs.