CVE-2025-11538

6.8 MEDIUM

📋 TL;DR

A vulnerability in Keycloak's server distribution exposes the Java Debug Wire Protocol (JDWP) port to all network interfaces when debug mode is enabled, allowing attackers on the same network segment to attach remote debuggers and execute arbitrary code within the Keycloak Java virtual machine. This affects Keycloak deployments where debug mode is enabled via the --debug flag. Organizations running Keycloak with debug mode enabled are at risk.

💻 Affected Systems

Products:
  • Keycloak
Versions: All versions prior to fixes in RHSA-2025:21370 and RHSA-2025:21371
Operating Systems: All operating systems running Keycloak
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when debug mode is explicitly enabled with --debug flag; default installations without debug mode are not affected.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full remote code execution within the Keycloak JVM, allowing complete compromise of the Keycloak server, access to authentication secrets, and potential lateral movement to connected systems.

🟠

Likely Case

Attackers on the same network segment can execute arbitrary code, potentially stealing sensitive authentication data, modifying user permissions, or disrupting authentication services.

🟢

If Mitigated

Minimal impact if debug mode is disabled or properly secured with network controls; debug functionality remains available only to authorized administrators.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires network access to the debug port; standard JDWP debugging tools can be used for exploitation without authentication.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions fixed in RHSA-2025:21370 and RHSA-2025:21371

Vendor Advisory: https://access.redhat.com/errata/RHSA-2025:21370

Restart Required: Yes

Instructions:

1. Update Keycloak to the patched version from Red Hat advisories. 2. Restart the Keycloak service. 3. Verify debug mode binds only to localhost if enabled.

🔧 Temporary Workarounds

Disable Debug Mode

all

Remove --debug flag from startup arguments to completely eliminate the vulnerability

Check Keycloak startup scripts and remove any '--debug' arguments

Restrict Debug Port with Firewall

linux

Block access to JDWP port (default 8787) from unauthorized networks

iptables -A INPUT -p tcp --dport 8787 -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 8787 -j DROP

🧯 If You Can't Patch

  • Disable debug mode immediately by removing --debug flag from all Keycloak instances
  • Implement strict network segmentation to isolate Keycloak servers from untrusted networks

🔍 How to Verify

Check if Vulnerable:

Check if Keycloak is running with --debug flag: ps aux | grep keycloak | grep --debug

Check Version:

keycloak.sh --version or check Keycloak admin console version

Verify Fix Applied:

Verify debug port binds only to localhost: netstat -tlnp | grep 8787 (should show 127.0.0.1:8787 not 0.0.0.0:8787)

📡 Detection & Monitoring

Log Indicators:

  • JDWP listening on all interfaces
  • Debug mode enabled warnings
  • Unexpected connections to debug port

Network Indicators:

  • Network scans targeting port 8787
  • JDWP protocol traffic from unauthorized sources

SIEM Query:

source_port:8787 OR dest_port:8787 AND NOT src_ip:127.0.0.1

🔗 References

📤 Share & Export