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-3738

CVE-2021-3738: Samba Use-After-Free Vulnerability

CVE-2021-3738 is a use-after-free vulnerability in Samba's DCE/RPC association groups that can cause crashes or privilege escalation. This article covers the technical details, affected versions, and mitigation strategies.

Published: February 25, 2026

CVE-2021-3738 Overview

CVE-2021-3738 is a Use-After-Free vulnerability affecting Samba's DCE/RPC implementation. The flaw exists in the handling of association groups, a mechanism that allows sharing of handles (cookies for resource state) between multiple connections. While the sam.ldb database is correctly shared between connections, the user credentials state is only pointed to rather than properly managed. When one connection within an association group ends, the database is left pointing at an invalid struct session_info, creating a dangerous use-after-free condition.

Critical Impact

This vulnerability could allow an authenticated attacker to crash Samba services or potentially escalate privileges by exploiting the use-after-free condition to access different user state with more privileged access.

Affected Products

  • Samba Samba (multiple versions)

Discovery Timeline

  • 2022-03-02 - CVE-2021-3738 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-3738

Vulnerability Analysis

This vulnerability is classified as CWE-416 (Use After Free), a memory corruption flaw that occurs when a program continues to use a pointer after the memory it references has been freed. In the context of Samba's DCE/RPC implementation, the vulnerability manifests in how association groups manage shared state across multiple connections.

The DCE/RPC protocol allows connections to share handles through association groups, enabling efficient resource management. These handles can reference connections to Samba's sam.ldb database, which stores security account information. The fundamental issue is that while the database itself is correctly shared among connections in an association group, the user credentials state (struct session_info) is merely pointed to rather than properly reference-counted or copied.

When a connection within an association group terminates, the struct session_info associated with that connection is deallocated. However, other connections in the same association group may still hold pointers to this now-freed memory. Subsequent access to this memory results in a use-after-free condition.

Root Cause

The root cause lies in improper memory management of the struct session_info within DCE/RPC association groups. The implementation failed to account for the lifecycle of user credential state when connections sharing an association group terminate independently. Specifically:

  1. Association groups allow multiple DCE/RPC connections to share resource handles
  2. The sam.ldb database handles are correctly reference-counted and shared
  3. However, struct session_info (containing user credentials) is only referenced by pointer
  4. When a connection ends, its session_info is freed while other connections may still reference it
  5. Subsequent access to the freed memory triggers the use-after-free condition

Attack Vector

The attack vector for CVE-2021-3738 requires network access and low-privilege authentication to the Samba server. An attacker can exploit this vulnerability by:

  1. Establishing multiple authenticated DCE/RPC connections to the Samba server
  2. Configuring these connections to share an association group
  3. Strategically terminating one connection while maintaining others in the same association group
  4. The remaining connections now hold a dangling pointer to freed session_info memory
  5. Triggering operations that access the invalid session_info pointer

The most likely outcome is a service crash causing denial of service. However, if the freed memory is reallocated with different content before access, an attacker could potentially manipulate the system into using a different user's session_info, leading to privilege escalation.

The vulnerability is described in detail in the Samba CVE-2021-3738 Advisory and tracked in Samba Bug Report #14468.

Detection Methods for CVE-2021-3738

Indicators of Compromise

  • Unexpected Samba service crashes, particularly involving DCE/RPC operations
  • Segmentation faults or memory access violations in Samba logs
  • Anomalous DCE/RPC connection patterns with rapid connection establishment and teardown
  • Authentication anomalies where users appear to have different privileges than expected

Detection Strategies

  • Monitor Samba service stability for unexpected restarts or crashes
  • Analyze system logs for memory-related errors (segfaults, SIGBUS) in smbd processes
  • Deploy network monitoring to detect unusual DCE/RPC association group behavior
  • Implement endpoint detection rules to identify exploitation attempts targeting session handling

Monitoring Recommendations

  • Enable verbose Samba logging to capture DCE/RPC connection lifecycle events
  • Configure crash dump collection for smbd processes to enable forensic analysis
  • Monitor for privilege escalation indicators such as unexpected administrative actions
  • Audit authentication logs for session inconsistencies

How to Mitigate CVE-2021-3738

Immediate Actions Required

  • Update Samba to the latest patched version immediately
  • Review Samba server logs for any indicators of exploitation attempts
  • Restrict network access to Samba services to trusted networks only
  • Consider temporarily disabling DCE/RPC services if not required for operations

Patch Information

Samba has released security patches to address this vulnerability. Administrators should consult the official Samba CVE-2021-3738 Advisory for specific patched versions and update instructions. Additionally, distribution-specific advisories such as Gentoo GLSA 202309-06 and Red Hat Bug Report #2021726 provide guidance for those platforms.

Workarounds

  • Limit network exposure of Samba services using firewall rules
  • Disable unnecessary DCE/RPC endpoints if they are not required
  • Implement network segmentation to restrict access to Samba servers
  • Monitor for unusual connection patterns and apply rate limiting if possible
bash
# Configuration example - Restrict network access to Samba
# Add to /etc/samba/smb.conf under [global] section
hosts allow = 192.168.1.0/24 127.0.0.1
hosts deny = ALL

# Restart Samba service after configuration changes
systemctl restart smbd

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

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechSamba

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.40%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-416
  • Technical References
  • Red Hat Bug Report #2021726

  • Gentoo GLSA 202309-06
  • Vendor Resources
  • Samba Bug Report #14468

  • Samba CVE-2021-3738 Advisory
  • Related CVEs
  • CVE-2022-32746: Samba AD LDAP Use-After-Free Vulnerability

  • CVE-2025-0620: Samba Authentication Bypass Vulnerability

  • CVE-2024-12087: Samba Rsync Path Traversal Vulnerability

  • CVE-2025-10230: Samba WINS Hook RCE 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