CVE-2025-27818

8.8 HIGH

📋 TL;DR

This CVE describes a Java deserialization vulnerability in Apache Kafka Connect that allows authenticated operators with configuration privileges to execute arbitrary code via LDAP login module manipulation. Attackers can achieve remote code execution by configuring connectors to use malicious LDAP servers that trigger deserialization gadget chains. This affects Kafka Connect clusters where users can override SASL JAAS configurations in connector settings.

💻 Affected Systems

Products:
  • Apache Kafka
  • Apache Kafka Connect
Versions: Apache Kafka 2.0.0+ (Kafka Connect 2.3.0+) with specific configurations
Operating Systems: All platforms running Java
Default Config Vulnerable: ✅ No
Notes: Default configurations are vulnerable starting from Apache Kafka 3.0.0. Prior versions require explicit connector client override policy configuration to be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with full compromise of the Kafka Connect server, potentially leading to data exfiltration, lateral movement, or complete system takeover.

🟠

Likely Case

Privilege escalation from authenticated operator to full system compromise, enabling data manipulation, credential theft, and persistence mechanisms.

🟢

If Mitigated

Limited impact with proper access controls and configuration validation, potentially only allowing denial of service or limited information disclosure.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires authenticated access with alterConfig privileges and ability to create/modify connectors. Attack leverages well-known Java deserialization patterns.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Apache Kafka 3.9.1/4.0.0

Vendor Advisory: https://kafka.apache.org/cve-list

Restart Required: Yes

Instructions:

1. Upgrade to Apache Kafka 3.9.1 or 4.0.0. 2. Apply the system property '-Dorg.apache.kafka.disallowed.login.modules' if using older versions. 3. Restart Kafka Connect services.

🔧 Temporary Workarounds

Disable vulnerable login modules

all

Add system property to disable LdapLoginModule and JndiLoginModule

-Dorg.apache.kafka.disallowed.login.modules=com.sun.security.auth.module.JndiLoginModule,com.sun.security.auth.module.LdapLoginModule

Implement connector client config override policy

all

Create 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 access controls to prevent unauthorized users from creating or modifying connectors
  • Validate all connector configurations and block any containing LDAP login module configurations

🔍 How to Verify

Check if Vulnerable:

Check if Kafka Connect version is 2.3.0+ and if connector configurations allow sasl.jaas.config overrides with LdapLoginModule

Check Version:

kafka-topics.sh --version or check Kafka Connect REST API / endpoint

Verify Fix Applied:

Verify Kafka Connect version is 3.9.1+ or 4.0.0+, and check that system property disallowing login modules is set

📡 Detection & Monitoring

Log Indicators:

  • Connector configurations containing 'LdapLoginModule'
  • Unexpected LDAP connection attempts from Kafka Connect
  • Java deserialization errors in logs

Network Indicators:

  • Outbound LDAP connections from Kafka Connect to unexpected destinations
  • Unusual network traffic patterns from Kafka Connect processes

SIEM Query:

source="kafka-connect" AND ("LdapLoginModule" OR "sasl.jaas.config" OR "com.sun.security.auth.module")

🔗 References

📤 Share & Export