The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-3827

CVE-2021-3827: Redhat Keycloak Auth Bypass Vulnerability

CVE-2021-3827 is an authentication bypass flaw in Redhat Keycloak that allows attackers to bypass MFA authentication using ECP binding flows. This post covers the technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-3827 Overview

A critical authentication bypass vulnerability was discovered in Red Hat Keycloak, where the default ECP (Enhanced Client or Proxy) binding flow allows other authentication flows to be bypassed. By exploiting this behavior, an attacker can bypass Multi-Factor Authentication (MFA) by sending a SOAP request with an AuthnRequest and Authorization header containing the user's credentials. This vulnerability represents a significant security risk as it undermines the fundamental security controls organizations rely on for protecting sensitive resources.

Critical Impact

Attackers can bypass MFA authentication controls in Keycloak by exploiting the ECP binding flow, potentially gaining unauthorized access to protected resources with only basic credentials.

Affected Products

  • Red Hat Keycloak (all versions prior to fix)
  • Red Hat Single Sign-On 7.0 and 7.5.0
  • Red Hat Enterprise Linux 7.0 and 8.0
  • Red Hat OpenShift Container Platform 4.8 and 4.9

Discovery Timeline

  • 2022-08-23 - CVE CVE-2021-3827 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-3827

Vulnerability Analysis

This vulnerability (CWE-287: Improper Authentication) exists within Keycloak's SAML protocol implementation, specifically in how the ECP binding flow processes authentication requests. The ECP profile is designed to enable non-browser clients to authenticate using SAML, but the default configuration allows it to circumvent other authentication mechanisms that should be enforced.

The flaw allows attackers with valid user credentials to completely bypass additional authentication factors such as OTP (One-Time Password), security keys, or other MFA mechanisms. This is particularly dangerous in enterprise environments where MFA is a critical security control for protecting sensitive applications and data.

The vulnerability requires network access and valid user credentials to exploit, but once those prerequisites are met, an attacker can authenticate as any user without completing the MFA challenge. The impact is primarily on confidentiality and integrity, as attackers could access protected resources and potentially modify data or configurations.

Root Cause

The root cause stems from Keycloak's default configuration enabling the ECP flow for all SAML clients without explicit opt-in. When processing SAML authentication requests via the ECP endpoint, Keycloak did not properly enforce that all configured authentication flows (including MFA) must be completed. The ECP binding processed the basic credentials in the Authorization header and granted access without triggering secondary authentication challenges.

Attack Vector

The attack is network-based and can be executed by any authenticated user with valid credentials. The attacker crafts a SOAP request targeting the ECP endpoint with an embedded SAML AuthnRequest. The request includes an HTTP Authorization header with the victim user's credentials (username and password). When processed by Keycloak, the ECP flow validates the credentials but skips the MFA challenge, issuing a valid SAML assertion that grants access to the target application.

http
POST /auth/realms/{realm}/protocol/saml/ecp HTTP/1.1
Host: keycloak-server.example.com
Content-Type: application/vnd.paos+xml
Authorization: Basic {base64-encoded-credentials}

<!-- SOAP envelope with AuthnRequest omitted for security -->

The vulnerability is exploitable whenever valid user credentials are available, whether through phishing, credential stuffing, or other means, effectively reducing the security posture to single-factor authentication.

Detection Methods for CVE-2021-3827

Indicators of Compromise

  • Unexpected SOAP requests to the /auth/realms/{realm}/protocol/saml/ecp endpoint
  • Successful authentications that skip configured MFA flows
  • Authorization headers containing Basic authentication in ECP endpoint requests
  • SAML assertions issued without corresponding MFA challenge completions
  • Anomalous login patterns where users authenticate without expected MFA events

Detection Strategies

  • Monitor Keycloak authentication logs for ECP endpoint access patterns
  • Implement alerts for SAML assertions issued without MFA event completion
  • Audit SAML client configurations for ECP flow enablement status
  • Review access logs for Content-Type: application/vnd.paos+xml requests
  • Correlate successful logins with missing MFA verification events

Monitoring Recommendations

  • Enable verbose logging for SAML authentication events in Keycloak
  • Configure SIEM rules to detect ECP endpoint abuse patterns
  • Monitor for unusual authentication flows that bypass expected MFA steps
  • Track changes to SAML client configurations, especially ECP-related settings

How to Mitigate CVE-2021-3827

Immediate Actions Required

  • Review all SAML client configurations and disable ECP flow where not explicitly required
  • Apply the latest Keycloak security patches from Red Hat
  • Audit recent authentication logs for potential exploitation attempts
  • Implement additional network-level controls to restrict ECP endpoint access

Patch Information

Red Hat has addressed this vulnerability by disabling the ECP flow by default for all SAML clients. The fix introduces a new configuration attribute saml.allow.ecp.flow that must be explicitly enabled for clients requiring ECP functionality. Organizations should apply the patched versions immediately.

For detailed patch information, refer to the Red Hat CVE-2021-3827 Advisory, Red Hat Bug Report #2007512, and the GitHub Security Advisory GHSA-4pc7-vqv5-5r3v.

The fix adds explicit ECP flow control in the SAML client configuration:

java
public boolean allowECPFlow() {
    return "true".equals(resolveAttribute(SamlConfigAttributes.SAML_ALLOW_ECP_FLOW));
}

public void setAllowECPFlow(boolean val) {
    client.setAttribute(SamlConfigAttributes.SAML_ALLOW_ECP_FLOW, Boolean.toString(val));
}

Source: Keycloak Commit Update

The new configuration attribute is defined as:

java
String SAML_ALLOW_ECP_FLOW = "saml.allow.ecp.flow";

Source: Keycloak Commit Update

Workarounds

  • Explicitly disable ECP flow for all SAML clients that do not require it
  • Implement network-level access controls to restrict access to the ECP endpoint
  • Use web application firewall rules to block or log PAOS content-type requests
  • Consider implementing additional authentication controls at the application layer
bash
# Keycloak CLI command to disable ECP flow for a SAML client
/opt/keycloak/bin/kcadm.sh update clients/{client-id} \
  -r {realm} \
  -s 'attributes."saml.allow.ecp.flow"=false'

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

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechRedhat Keycloak

  • SeverityMEDIUM

  • CVSS Score6.8

  • EPSS Probability0.21%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-287
  • Technical References
  • GitHub Security Advisory GHSA-4pc7-vqv5-5r3v
  • Vendor Resources
  • Red Hat CVE-2021-3827 Advisory

  • Red Hat Bug Report #2007512

  • Keycloak Commit Update
  • Related CVEs
  • CVE-2023-0091: Redhat Keycloak Auth Bypass Vulnerability

  • CVE-2023-0105: Redhat Keycloak Auth Bypass Vulnerability

  • CVE-2023-6927: Redhat Keycloak Auth Bypass Vulnerability

  • CVE-2023-0264: Red Hat Keycloak Auth Bypass Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English