CVE-2023-25194
📋 TL;DR
This vulnerability allows authenticated attackers to execute arbitrary code on Apache Kafka Connect servers by exploiting JNDI injection through SASL JAAS configuration. Attackers can achieve remote code execution by manipulating connector configurations to load malicious LDAP responses. This affects Kafka Connect clusters running versions 2.3.0 through 3.3.x with default or permissive configurations.
💻 Affected Systems
- Apache Kafka Connect
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Full remote code execution leading to complete system compromise, data exfiltration, and lateral movement within the network.
Likely Case
Unauthorized code execution allowing attackers to steal sensitive data, deploy malware, or disrupt Kafka operations.
If Mitigated
Limited to authenticated users with connector modification privileges; proper controls can prevent exploitation entirely.
🎯 Exploit Status
Requires authenticated access to Kafka Connect REST API and ability to create/modify connectors. Similar JNDI injection patterns have been weaponized in other Java applications.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Apache Kafka 3.4.0+
Vendor Advisory: https://kafka.apache.org/cve-list
Restart Required: Yes
Instructions:
1. Upgrade to Apache Kafka 3.4.0 or later. 2. Apply the system property '-Dorg.apache.kafka.disallowed.login.modules=com.sun.security.auth.module.JndiLoginModule' if using older versions. 3. Restart Kafka Connect services.
🔧 Temporary Workarounds
Disable JndiLoginModule via system property
allAdd JVM argument to disable the vulnerable login module
-Dorg.apache.kafka.disallowed.login.modules=com.sun.security.auth.module.JndiLoginModule
Implement connector client config override policy
allCreate custom policy to restrict which Kafka client properties can be overridden
Set connector.client.config.override.policy property in Kafka Connect configuration
🧯 If You Can't Patch
- Implement strict connector client config override policies to block sasl.jaas.config overrides
- Restrict access to Kafka Connect REST API to only trusted administrators and monitor connector configuration changes
🔍 How to Verify
Check if Vulnerable:
Check Kafka Connect version and configuration. Versions 2.3.0-3.3.x with permissive connector policies are vulnerable.
Check Version:
kafka-topics.sh --version or check Kafka Connect server logs for version information
Verify Fix Applied:
Verify Kafka Connect version is 3.4.0+ or system property disallowing JndiLoginModule is set. Test connector configuration attempts with sasl.jaas.config overrides should be rejected.
📡 Detection & Monitoring
Log Indicators:
- Connector configuration changes containing 'sasl.jaas.config' with 'JndiLoginModule'
- LDAP connection attempts from Kafka Connect processes
- Java deserialization errors in logs
Network Indicators:
- Outbound LDAP connections from Kafka Connect servers to unexpected destinations
- Unusual network traffic patterns from Kafka Connect processes
SIEM Query:
source="kafka-connect" AND ("sasl.jaas.config" OR "JndiLoginModule" OR "com.sun.security.auth.module")
🔗 References
- http://packetstormsecurity.com/files/173151/Apache-Druid-JNDI-Injection-Remote-Code-Execution.html
- https://kafka.apache.org/cve-list
- https://lists.apache.org/thread/vy1c7fqcdqvq5grcqp6q5jyyb302khyz
- http://packetstormsecurity.com/files/173151/Apache-Druid-JNDI-Injection-Remote-Code-Execution.html
- https://kafka.apache.org/cve-list
- https://lists.apache.org/thread/vy1c7fqcdqvq5grcqp6q5jyyb302khyz