Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2020-27838

CVE-2020-27838: Keycloak Information Disclosure Flaw

CVE-2020-27838 is an information disclosure vulnerability in Red Hat Keycloak that exposes client secrets through unauthenticated endpoints. This article covers the technical details, affected versions, and mitigation.

Published:

CVE-2020-27838 Overview

A significant information disclosure vulnerability was discovered in Red Hat Keycloak, an open-source identity and access management solution. The flaw exists in the client registration endpoint, which allows unauthenticated users to fetch sensitive information about PUBLIC clients, including client secrets. This becomes particularly problematic when a PUBLIC client is later reconfigured as a CONFIDENTIAL client, as the previously exposed secret may still be valid and accessible to attackers.

Critical Impact

Unauthenticated attackers can retrieve client secrets from PUBLIC clients, potentially enabling unauthorized access if clients are later upgraded to CONFIDENTIAL status without secret rotation.

Affected Products

  • Red Hat Keycloak versions prior to 13.0.0
  • Red Hat Single Sign-On 7.0

Discovery Timeline

  • 2021-03-08 - CVE-2020-27838 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2020-27838

Vulnerability Analysis

This vulnerability is classified as an Authentication Bypass issue (CWE-287: Improper Authentication). The core problem lies in the client registration endpoint's failure to enforce proper authentication when handling requests for PUBLIC client information.

In OAuth 2.0 and OpenID Connect implementations, clients are categorized as either PUBLIC (unable to maintain the confidentiality of their credentials) or CONFIDENTIAL (capable of maintaining credential confidentiality). Keycloak's client registration endpoint is designed to manage these client configurations, but the vulnerable versions fail to restrict access to PUBLIC client data.

The vulnerability poses a significant risk because:

  1. Initial Exposure: When a client is registered as PUBLIC, its configuration data (including any associated secrets) can be retrieved without authentication
  2. Persistence of Risk: If an administrator later changes the client type from PUBLIC to CONFIDENTIAL, the previously exposed client secret remains unchanged
  3. Authentication Compromise: An attacker who captured the client secret during the PUBLIC phase can use it to impersonate the now-CONFIDENTIAL client

Root Cause

The root cause of this vulnerability is improper authentication enforcement in the client registration endpoint. The endpoint fails to validate that incoming requests are properly authenticated before returning sensitive client configuration data, including client secrets, for PUBLIC clients.

Attack Vector

The attack vector is network-based, requiring no prior authentication. An attacker can exploit this vulnerability by making direct HTTP requests to the Keycloak client registration endpoint. The attack requires user interaction in the form of an administrator changing a client from PUBLIC to CONFIDENTIAL without rotating the client secret.

The exploitation process involves:

  1. An attacker identifies the Keycloak server and enumerates registered PUBLIC clients
  2. The attacker makes unauthenticated requests to the client registration endpoint to retrieve client configuration, including secrets
  3. If a PUBLIC client is later promoted to CONFIDENTIAL status, the attacker can use the previously captured credentials to impersonate the client

For technical details on the vulnerability mechanism, refer to the Red Hat Bug Report #1906797.

Detection Methods for CVE-2020-27838

Indicators of Compromise

  • Unusual or repeated unauthenticated requests to the /auth/realms/{realm}/clients-registrations/ endpoint
  • Access logs showing enumeration patterns against client registration endpoints
  • Unexpected authentication attempts using previously PUBLIC client credentials
  • Evidence of client configuration data being retrieved by unknown IP addresses

Detection Strategies

  • Monitor access logs for unauthenticated GET requests to the client registration endpoint
  • Implement alerting on high volumes of requests to client registration APIs from single sources
  • Audit client type changes from PUBLIC to CONFIDENTIAL and verify secret rotation occurred
  • Review authentication logs for suspicious client authentication attempts post-configuration changes

Monitoring Recommendations

  • Enable detailed access logging for all Keycloak administrative endpoints
  • Implement rate limiting on the client registration endpoint to detect enumeration attempts
  • Set up alerts for any client type modifications in the Keycloak admin console
  • Deploy network-level monitoring to detect reconnaissance activity against identity infrastructure

How to Mitigate CVE-2020-27838

Immediate Actions Required

  • Upgrade Red Hat Keycloak to version 13.0.0 or later immediately
  • Audit all existing clients that were previously configured as PUBLIC and have been changed to CONFIDENTIAL
  • Rotate client secrets for any clients that have transitioned from PUBLIC to CONFIDENTIAL status
  • Review access logs for any historical evidence of unauthorized client registration endpoint access

Patch Information

Red Hat has addressed this vulnerability in Keycloak version 13.0.0 and later. Organizations using Red Hat Single Sign-On should apply the corresponding security updates. Detailed patch information and updates are available through the Red Hat Bug Report #1906797.

Workarounds

  • Implement network-level access controls to restrict access to the client registration endpoint
  • Configure a web application firewall (WAF) to require authentication for all client registration requests
  • Establish a policy requiring immediate secret rotation whenever a client type is changed from PUBLIC to CONFIDENTIAL
  • Consider disabling the client registration endpoint if dynamic client registration is not required for your deployment
bash
# Configuration example - Restrict client registration endpoint via reverse proxy (nginx)
# Add to nginx configuration for Keycloak
location ~ ^/auth/realms/.*/clients-registrations/ {
    # Require authentication or restrict to internal networks
    allow 10.0.0.0/8;
    allow 192.168.0.0/16;
    deny all;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.