Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-20277

CVE-2021-20277: Samba LDAP Denial of Service Vulnerability

CVE-2021-20277 is a denial of service flaw in Samba's libldb where consecutive leading spaces in LDAP attributes cause memory corruption. This article covers the technical details, affected versions, and solutions.

Published: March 4, 2026

CVE-2021-20277 Overview

A flaw was found in Samba's libldb library that affects LDAP attribute parsing. When processing LDAP attributes containing multiple, consecutive leading spaces, the parsing logic fails to properly handle boundary conditions, resulting in an out-of-bounds memory write. This memory corruption leads to a crash of the LDAP server process handling the malicious request, causing a denial of service condition.

Critical Impact

Remote attackers can crash Samba LDAP server processes by sending specially crafted LDAP requests with malformed attributes containing consecutive leading spaces, causing system availability disruption.

Affected Products

  • Samba (multiple versions)
  • Debian Linux 9.0 and 10.0
  • Fedora 32, 33, and 34

Discovery Timeline

  • May 12, 2021 - CVE-2021-20277 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2021-20277

Vulnerability Analysis

This vulnerability exists in Samba's libldb library, which provides an LDAP-like database API used by Samba's Active Directory Domain Controller (AD DC) functionality. The flaw is triggered when the library parses LDAP attributes that contain multiple consecutive leading spaces.

The vulnerability is classified as both CWE-125 (Out-of-Bounds Read) and CWE-787 (Out-of-Bounds Write), indicating that the parsing logic can read beyond allocated buffer boundaries and subsequently write to memory locations outside the intended buffer. This memory corruption directly impacts the stability of the LDAP server process.

The attack can be executed remotely over the network without requiring authentication or user interaction, making it particularly concerning for internet-facing Samba deployments acting as domain controllers.

Root Cause

The root cause lies in improper boundary checking within libldb's LDAP attribute parsing routines. When the parser encounters multiple consecutive leading spaces in an attribute value, it miscalculates the buffer boundaries needed for processing. This miscalculation leads to memory operations that extend beyond the allocated buffer, corrupting adjacent memory regions and causing the LDAP server process to crash.

Attack Vector

An attacker can exploit this vulnerability by sending specially crafted LDAP requests to a vulnerable Samba server. The attack requires network access to the LDAP service (typically port 389 or 636 for LDAPS). The malicious request contains LDAP attributes with multiple consecutive leading spaces that trigger the out-of-bounds memory write condition.

The exploitation mechanism involves crafting LDAP bind or search requests with attribute values that begin with several consecutive space characters. When the Samba LDAP server processes these malformed attributes through libldb, the parsing logic fails to correctly handle the whitespace sequence, leading to memory corruption and process termination.

Detection Methods for CVE-2021-20277

Indicators of Compromise

  • Unexpected crashes or restarts of the Samba LDAP server process (samba or smbd)
  • Core dumps or crash logs indicating memory corruption in libldb functions
  • LDAP service unavailability following receipt of unusual LDAP requests
  • Log entries showing malformed LDAP attribute processing errors

Detection Strategies

  • Monitor Samba process stability and implement alerting for unexpected service terminations
  • Analyze LDAP traffic for requests containing attributes with unusual whitespace patterns
  • Implement intrusion detection rules to flag LDAP requests with excessive leading spaces in attribute values
  • Review Samba logs for parsing errors or warnings related to LDAP attribute handling

Monitoring Recommendations

  • Enable verbose logging for Samba LDAP services to capture attribute parsing details
  • Configure system monitoring to track Samba process health and automatic restart events
  • Deploy network-based monitoring for LDAP protocol anomalies targeting Samba servers
  • Implement application crash monitoring with core dump analysis capabilities

How to Mitigate CVE-2021-20277

Immediate Actions Required

  • Update Samba to the latest patched version available for your distribution
  • Review firewall rules to restrict LDAP service access to trusted networks only
  • Implement network segmentation to limit exposure of Samba AD DC services
  • Enable rate limiting on LDAP connections to reduce denial of service impact

Patch Information

Samba has released security patches addressing this vulnerability. System administrators should apply updates through their distribution's package management system. Detailed patch information is available in the Samba Security Advisory.

Distribution-specific advisories:

  • Debian Security Advisory DSA-4884
  • Debian LTS Announcement
  • Gentoo GLSA-202105-22
  • Red Hat Bug Report

Workarounds

  • Restrict network access to LDAP services using firewall rules to limit exposure to trusted clients only
  • Implement network-level rate limiting to mitigate the impact of potential denial of service attempts
  • Deploy a Web Application Firewall (WAF) or LDAP proxy that can inspect and filter malformed LDAP requests
  • Consider temporarily disabling LDAP services if they are not critical until patches can be applied
bash
# Example firewall configuration to restrict LDAP access
# Limit LDAP (389) and LDAPS (636) to trusted networks only
iptables -A INPUT -p tcp --dport 389 -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -p tcp --dport 389 -j DROP
iptables -A INPUT -p tcp --dport 636 -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -p tcp --dport 636 -j DROP

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechSamba

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability14.90%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-125

  • CWE-787
  • Technical References
  • Red Hat Bug Report

  • Debian LTS Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA Advisory

  • NetApp Security Advisory

  • Debian Security Advisory
  • Vendor Resources
  • Samba CVE Analysis
  • Related CVEs
  • CVE-2022-32745: Samba Samba DOS Vulnerability

  • CVE-2022-0336: Samba AD DC SPN Bypass DoS Vulnerability

  • CVE-2020-27840: Samba Denial of Service Vulnerability

  • CVE-2020-14323: Samba Winbind Service DoS 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