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
    • 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-3999

CVE-2021-3999: Gnu Glibc Buffer Overflow Vulnerability

CVE-2021-3999 is a buffer overflow flaw in Gnu Glibc's getcwd() function that can lead to privilege escalation. This article covers the technical details, affected versions, security impact, and mitigation strategies.

Published: March 4, 2026

CVE-2021-3999 Overview

A critical off-by-one buffer overflow and underflow vulnerability has been discovered in the GNU C Library (glibc), specifically within the getcwd() function. When the buffer size passed to getcwd() is exactly 1 byte, the function may trigger memory corruption due to improper boundary handling. This flaw can be exploited by a local attacker who can control the input buffer and size parameters passed to getcwd() within a setuid program, potentially leading to arbitrary code execution and privilege escalation on the affected system.

Critical Impact

Local attackers can exploit this vulnerability in setuid programs to achieve arbitrary code execution and escalate privileges to root-level access on vulnerable Linux systems.

Affected Products

  • GNU glibc (multiple versions)
  • Debian Linux 10.0 and 11.0
  • NetApp E-Series Performance Analyzer
  • NetApp NFS Plug-in for VMware VAAI
  • NetApp ONTAP Select Deploy Administration Utility
  • NetApp H300S, H500S, H700S, H410S, and H410C firmware and hardware

Discovery Timeline

  • 2022-08-24 - CVE-2021-3999 published to NVD
  • 2025-12-02 - Last updated in NVD database

Technical Details for CVE-2021-3999

Vulnerability Analysis

This vulnerability exists in the getcwd() function of glibc, which retrieves the current working directory of the calling process. The flaw manifests when the size parameter is set to exactly 1 byte, creating a boundary condition that the function fails to handle correctly.

The getcwd() function is designed to copy the absolute pathname of the current working directory into the supplied buffer. When a buffer size of 1 is provided, the function's internal logic incorrectly handles the boundary calculation, resulting in both an off-by-one overflow and underflow condition. This dual memory corruption scenario is particularly dangerous because it can corrupt adjacent memory regions in predictable ways.

The vulnerability becomes exploitable when an attacker can influence the parameters passed to getcwd() within a setuid program. Since setuid programs run with elevated privileges (typically root), successful exploitation allows the attacker to execute arbitrary code with those elevated privileges, effectively compromising the entire system.

Root Cause

The root cause is an off-by-one error (CWE-193) in the getcwd() implementation. When processing a buffer of size 1, the function's boundary checking logic fails to account for the null terminator requirement, leading to writes outside the allocated buffer boundaries. This implementation flaw results in both buffer overflow (writing past the end) and buffer underflow (writing before the start) conditions depending on the execution path.

Attack Vector

The attack requires local access to the system. An attacker must identify a setuid program that calls getcwd() with user-controllable buffer and size parameters. By carefully crafting the input to specify a buffer size of exactly 1, the attacker can trigger the memory corruption condition. Through techniques such as heap manipulation and careful memory layout control, the attacker can redirect program execution to achieve arbitrary code execution with the elevated privileges of the setuid program.

The vulnerability mechanism involves passing a carefully sized buffer to getcwd(). When the size is exactly 1 byte, the function's internal path resolution logic fails to properly validate buffer boundaries before writing. This creates a memory corruption primitive that can be leveraged for code execution. See the Sourceware Bug Report #28769 for additional technical details.

Detection Methods for CVE-2021-3999

Indicators of Compromise

  • Unexpected crashes or segmentation faults in setuid programs that utilize getcwd() function calls
  • Anomalous privilege escalation events from low-privileged user accounts to root
  • Memory corruption artifacts in process dumps showing irregular patterns near path buffer allocations
  • Unusual system call patterns involving getcwd() with abnormally small buffer sizes

Detection Strategies

  • Monitor system calls using tools like auditd to track getcwd() invocations with buffer sizes of 1 byte
  • Implement runtime application self-protection (RASP) to detect buffer overflow attempts in glibc functions
  • Deploy endpoint detection solutions capable of identifying exploitation attempts targeting setuid binaries
  • Use memory sanitizers (ASAN, MSAN) in development and testing environments to catch boundary violations

Monitoring Recommendations

  • Enable comprehensive logging for setuid program execution and track any anomalous behavior patterns
  • Configure system auditing to alert on privilege escalation events originating from unexpected processes
  • Implement file integrity monitoring on critical setuid binaries to detect tampering or exploitation artifacts
  • Review system logs regularly for signs of exploitation attempts or unusual getcwd() usage patterns

How to Mitigate CVE-2021-3999

Immediate Actions Required

  • Update glibc to the latest patched version available for your distribution immediately
  • Review and audit all setuid programs on the system for potential exposure to this vulnerability
  • Apply vendor-specific security patches from Debian, Red Hat, and NetApp as applicable to your environment
  • Consider temporarily removing setuid bits from non-essential programs until patching is complete

Patch Information

Security patches addressing this vulnerability are available from multiple vendors. The fix has been committed to the glibc source repository as documented in the glibc Git Commit Log. Distribution-specific patches are available through:

  • Red Hat CVE-2021-3999 Advisory
  • Debian Security Tracker CVE-2021-3999
  • NetApp Security Advisory NTAP-20221104-0001

System administrators should prioritize updating glibc packages and reboot systems to ensure the new library is loaded by all processes.

Workarounds

  • Implement application-level input validation to prevent buffer sizes of 1 from being passed to getcwd()
  • Use SELinux or AppArmor policies to restrict the execution context of potentially vulnerable setuid programs
  • Deploy seccomp filters to monitor and restrict system calls in sensitive applications
  • Consider using static analysis tools to identify code paths that may expose the vulnerable function with small buffers
bash
# Check current glibc version
ldd --version

# List setuid programs that may need review
find / -perm -4000 -type f 2>/dev/null

# Update glibc on Debian/Ubuntu
sudo apt update && sudo apt upgrade libc6

# Update glibc on RHEL/CentOS
sudo yum update glibc

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechGnu Glibc

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.78%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-193
  • Technical References
  • Red Hat CVE-2021-3999 Advisory

  • Red Hat Bug Report #2024637

  • Debian LTS Announcement

  • Debian Security Tracker CVE-2021-3999

  • NetApp Security Advisory NTAP-20221104-0001

  • Sourceware Bug Report #28769

  • glibc Git Commit Log

  • Openwall OSS-Security Discussion
  • Related CVEs
  • CVE-2026-5928: GNU Glibc Buffer Overflow Vulnerability

  • CVE-2026-5450: GNU Glibc Buffer Overflow Vulnerability

  • CVE-2024-33599: GNU Glibc Buffer Overflow Vulnerability

  • CVE-2024-33602: GNU Glibc Buffer Overflow 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