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

CVE-2021-21284: Docker Privilege Escalation Vulnerability

CVE-2021-21284 is a privilege escalation vulnerability in Docker affecting the --userns-remap option. Attackers with remapped root access can escalate to real root privileges. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 25, 2026

CVE-2021-21284 Overview

CVE-2021-21284 is a privilege escalation vulnerability in Docker that affects the --userns-remap feature. When user namespace remapping is enabled, the root user within the remapped namespace can escalate privileges to the actual host root if they have access to the host filesystem. This occurs because an attacker with access to the remapped root can modify files under /var/lib/docker/<remapping> that cause writing files with extended privileges, effectively bypassing the container isolation that user namespace remapping is designed to provide.

Critical Impact

Attackers with remapped root access can escalate to real host root privileges by manipulating files in the Docker data directory, completely undermining the security boundaries of user namespace remapping.

Affected Products

  • Docker versions prior to 19.03.15
  • Docker versions prior to 20.10.3
  • Debian Linux 10.0
  • NetApp E-Series SANtricity OS Controller

Discovery Timeline

  • 2021-02-02 - CVE-2021-21284 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-21284

Vulnerability Analysis

This vulnerability is classified as CWE-22 (Path Traversal) and involves improper permission handling in Docker's user namespace remapping implementation. The --userns-remap feature is designed to run container processes as a non-privileged user on the host system, even when they appear to run as root inside the container. However, a flaw in how Docker set directory permissions allowed a remapped root user to traverse and modify files in /var/lib/docker/<remapping>, enabling them to write files with elevated privileges.

The vulnerability requires adjacent network access and low privileges to exploit, with no user interaction necessary. The primary impact is on integrity, as successful exploitation allows unauthorized file modifications that lead to privilege escalation beyond the intended container boundaries.

Root Cause

The root cause lies in how Docker created and set permissions on container-related directories. The daemon used daemon.idMapping.RootPair() to set ownership of critical directories like the container root and checkpoint directories, combined with restrictive 0700 permissions. This allowed the remapped root user to own and access these directories, enabling them to modify files that would later be interpreted with host root privileges.

The fix changed the ownership model to use idtools.CurrentIdentity() (the actual daemon user identity) instead of the remapped root pair, and adjusted permissions to 0701 where appropriate, ensuring that the remapped user cannot modify sensitive Docker daemon files.

Attack Vector

The attack requires the following conditions:

  1. Docker configured with --userns-remap option enabled
  2. An attacker with root access within a container using user namespace remapping
  3. Some form of access to the host filesystem (e.g., through volume mounts or container escape)

Once these conditions are met, the attacker can manipulate files under the Docker data directory to write files with extended host privileges, effectively escaping the user namespace isolation.

go
// Security patch in daemon/container_operations_unix.go
// Before: Directory owned by remapped root pair
// After: Directory owned by current daemon identity

 	if err != nil {
 		return err
 	}
-	return idtools.MkdirAllAndChown(p, 0700, daemon.idMapping.RootPair())
+	return idtools.MkdirAllAndChown(p, 0701, idtools.CurrentIdentity())
}

Source: Moby GitHub Commit

go
// Security patch in daemon/create.go
// Changed ownership from remapped root to current identity

 	}
 	ctr.RWLayer = rwLayer

-	rootIDs := daemon.idMapping.RootPair()
-
-	if err := idtools.MkdirAndChown(ctr.Root, 0700, rootIDs); err != nil {
+	if err := idtools.MkdirAndChown(ctr.Root, 0701, idtools.CurrentIdentity()); err != nil {
 		return nil, err
 	}
-	if err := idtools.MkdirAndChown(ctr.CheckpointDir(), 0700, rootIDs); err != nil {
+	if err := idtools.MkdirAndChown(ctr.CheckpointDir(), 0700, idtools.CurrentIdentity()); err != nil {
 		return nil, err
 	}

Source: Moby GitHub Commit

Detection Methods for CVE-2021-21284

Indicators of Compromise

  • Unexpected file ownership changes under /var/lib/docker/ directories
  • Files created with elevated privileges originating from container processes
  • Unusual write activity in Docker remapping directories by container users
  • Container processes accessing or modifying files outside expected volume mounts

Detection Strategies

  • Monitor file system activity in /var/lib/docker/<remapping> directories for unauthorized modifications
  • Audit Docker daemon logs for containers running with --userns-remap that access sensitive host paths
  • Deploy runtime container security tools that detect privilege escalation attempts
  • Implement file integrity monitoring (FIM) on Docker data directories

Monitoring Recommendations

  • Enable Docker daemon audit logging to track container file system operations
  • Configure alerts for any container process attempting to write to /var/lib/docker/ paths
  • Use SentinelOne's container runtime protection to detect real-time privilege escalation behaviors
  • Monitor for processes running as the remapped UID that access files owned by actual root

How to Mitigate CVE-2021-21284

Immediate Actions Required

  • Upgrade Docker to version 20.10.3 or 19.03.15 immediately
  • Audit all running containers using --userns-remap for potential compromise
  • Review and restrict volume mounts that provide container access to host filesystem paths
  • Temporarily disable --userns-remap if patching cannot be performed immediately

Patch Information

Docker has released patched versions that address this vulnerability by changing how directory ownership and permissions are set during container creation:

  • Docker 20.10.3: Contains the security fix for this vulnerability (Docker Release Notes)
  • Docker 19.03.15: Backported fix for the 19.03 release branch (Moby Release v19.03.15)

The patch modifies the daemon to use idtools.CurrentIdentity() instead of daemon.idMapping.RootPair() when setting ownership on container directories, ensuring that the remapped root user cannot manipulate these files. Additional security advisories have been issued by Debian (DSA-4865), Gentoo (GLSA 202107-23), and NetApp (NTAP-20210226-0005).

Workarounds

  • Disable --userns-remap feature if not strictly required for your deployment
  • Restrict container access to the host filesystem by avoiding bind mounts to sensitive directories
  • Run containers with --read-only filesystem where possible to prevent write operations
  • Implement strict AppArmor or SELinux profiles to limit container file system access
bash
# Check current Docker version
docker version --format '{{.Server.Version}}'

# Verify if userns-remap is enabled
docker info --format '{{.SecurityOptions}}'

# Upgrade Docker on Debian/Ubuntu
sudo apt-get update && sudo apt-get install docker-ce=5:20.10.3~3-0~ubuntu-focal

# Disable userns-remap temporarily (restart required)
# Remove --userns-remap from /etc/docker/daemon.json or daemon startup flags
sudo systemctl restart docker

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

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechDocker

  • SeverityMEDIUM

  • CVSS Score6.8

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-22
  • Technical References
  • Moby Release v19.03.15

  • Moby Release v20.10.3

  • GitHub Security Advisory GHSA-7452-xqpj-6rpc

  • NetApp Security Advisory NTAP-20210226-0005

  • Debian Security Advisory DSA-4865
  • Vendor Resources
  • Docker Release Notes 20.10.3

  • Moby GitHub Commit

  • Gentoo GLSA 2021-07-23
  • Related CVEs
  • CVE-2025-15558: Docker CLI Privilege Escalation Vulnerability

  • CVE-2026-28400: Docker Model Runner Privilege Escalation

  • CVE-2026-2664: Docker Desktop Privilege Escalation Flaw

  • CVE-2025-14740: Docker Desktop Privilege Escalation Flaw
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