8000 Following an LDAP referral sends the configured bind credentials to the referral's target server, which can be any host · Issue #55764 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Following an LDAP referral sends the configured bind credentials to the referral's target server, which can be any host #55764

Backlog

Description

@ssilvert

Describe the bug

When an LDAP user federation provider has Referral set to follow, Keycloak follows any ldap:// or ldaps:// referral that the configured LDAP server returns during a search. It then reconnects to the host named in the referral using the same bind DN and bind credential configured for the trusted LDAP server. Keycloak checks only the referral URL's scheme and never compares the referral's host with the configured server. As a result, the service account's bind credentials can be sent, as a simple bind, to any host that Keycloak can reach over the network.

This can be triggered in two ways:

  • A man-in-the-middle on an ldap:// connection without StartTLS can inject a referral that sends the credentials to a collector host.
  • A compromised or partially trusted LDAP server, or anyone who can write a referral entry within the search scope Keycloak queries, can return a referral that harvests the credentials or relays them to internal hosts reachable from the Keycloak server.

The hardening for CVE-2025-13467 (#44993) limits followed referrals to ldap/ldaps URLs. That fix works as intended. It does not cover this case, because the leak happens on the plain LDAP URL path that it still allows.

Version

main, commit 1333cf9f6de71171c737abdaca53550932a37891 (2026-11-25)

Expected behavior

When following a referral, Keycloak sends the configured bind credentials only to the configured LDAP server or to hosts the administrator has explicitly trusted. A referral to any other host is either not followed or followed without the service account's bind credentials.

Actual behavior

When Referral is follow, any referral the configured LDAP server returns causes Keycloak to send the service account's bind DN and password to the referral's target host. This happens no matter which host the referral names. A host that the administrator never configured receives the federation service account's credentials. These are usually a privileged LDAP/AD service account's credentials, and with them that host can read or modify the federated directory.

Acknowledgement

Thank you to HocVoNgThai for reporting this issue. As following referrals is an opt-in setting and both exploitation paths require an untrusted network path to, or a compromise of, the administrator-configured LDAP server, this is considered a weakness and handled publicly.


This issue was originally tracked in the private repository. Migrated by @ssilvert.

Activity

  1. added
    priority/important
    area/ldap
    on Dec 2, 2026
  2. added theissue type on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ldapkind/weaknesspriority/importantteam/core-iam

    Fields

    No fields configured for weakness.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0