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

CVE-2021-36085: SELinux Use-After-Free Vulnerability

CVE-2021-36085 is a use-after-free flaw in the SELinux 3.2 CIL compiler affecting __cil_verify_classperms function. This vulnerability poses security risks to systems running affected versions. This article covers technical details, impact, and mitigation.

Published: February 25, 2026

CVE-2021-36085 Overview

CVE-2021-36085 is a use-after-free vulnerability in the CIL (Common Intermediate Language) compiler component of SELinux 3.2. The vulnerability exists in the __cil_verify_classperms function, which is called from __verify_map_perm_classperms and hashtab_map. This memory corruption issue can lead to a denial of service condition when processing maliciously crafted CIL policy files.

Critical Impact

A local attacker with low privileges can trigger a use-after-free condition in the SELinux CIL compiler, potentially causing application crashes and denial of service during policy compilation.

Affected Products

  • SELinux Project SELinux 3.2
  • Fedora Project Fedora 35
  • Systems utilizing libsepol CIL compiler functionality

Discovery Timeline

  • 2021-07-01 - CVE CVE-2021-36085 published to NVD
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2021-36085

Vulnerability Analysis

This vulnerability is classified as CWE-416 (Use After Free), a memory corruption flaw where a program continues to reference memory after it has been freed. In the context of the SELinux CIL compiler, the issue occurs during the verification of class permissions within the policy compilation process.

The vulnerable code path involves the __cil_verify_classperms function, which is invoked through the hash table mapping operations (hashtab_map) and permission verification routines (__verify_map_perm_classperms). When processing certain CIL policy configurations, the compiler improperly accesses memory that has already been deallocated, leading to undefined behavior.

The vulnerability requires local access to the system and the ability to provide input to the CIL compiler. While the impact is limited to availability (denial of service), the use-after-free class of vulnerabilities can sometimes be leveraged for more severe attacks in specific circumstances.

Root Cause

The root cause lies in improper memory management within the CIL policy reset functionality. Specifically, when resetting map permissions, the classperm list was being reset rather than properly destroyed. The cil_reset_classperms_list function was called on perm->classperms, which left dangling references to freed memory. The fix replaces this with cil_list_destroy(&perm->classperms, CIL_FALSE), which properly destroys the list and prevents the use-after-free condition.

Attack Vector

The attack vector for CVE-2021-36085 requires local access with low privileges. An attacker must be able to provide malformed or specially crafted CIL policy input to the SELinux compiler. This could occur in scenarios where:

  • Users have access to compile SELinux policies on shared systems
  • Automated policy compilation processes accept user-controlled input
  • Development or testing environments process untrusted CIL files

The vulnerability was discovered through automated fuzzing via Google's OSS-Fuzz project, indicating that triggering the flaw requires specific malformed input patterns.

c
// Security patch from libsepol/cil/src/cil_reset_ast.c
// Source: GitHub SELinux Commit 2d35fcc
 
static void cil_reset_perm(struct cil_perm *perm)
{
-	cil_reset_classperms_list(perm->classperms);
+	cil_list_destroy(&perm->classperms, CIL_FALSE);
}
 
static inline void cil_reset_classperms(struct cil_classperms *cp)

Source: GitHub SELinux Commit 2d35fcc

Detection Methods for CVE-2021-36085

Indicators of Compromise

  • Unexpected crashes or segmentation faults in the secilc CIL compiler process
  • Core dumps referencing __cil_verify_classperms, __verify_map_perm_classperms, or hashtab_map functions
  • Abnormal termination of SELinux policy compilation jobs
  • Memory access violation errors in libsepol library operations

Detection Strategies

  • Monitor for abnormal process terminations involving SELinux compilation tools (secilc, semodule)
  • Implement application crash monitoring for libsepol-dependent processes
  • Review system logs for segmentation fault entries associated with policy management utilities
  • Deploy runtime memory safety tools (AddressSanitizer, Valgrind) in development environments to detect use-after-free conditions

Monitoring Recommendations

  • Enable core dump collection and analysis for SELinux-related processes
  • Implement centralized logging for policy compilation activities
  • Set up alerts for repeated crashes in policy compilation workflows
  • Monitor for unusual patterns of CIL policy file submissions in multi-user environments

How to Mitigate CVE-2021-36085

Immediate Actions Required

  • Upgrade SELinux/libsepol to a version containing commit 2d35fcc7e9e976a2346b1de20e54f8663e8a6cba or later
  • Apply vendor-provided security patches for your Linux distribution
  • Restrict access to CIL policy compilation functionality to trusted administrators only
  • Review and validate any externally sourced CIL policy files before compilation

Patch Information

The vulnerability was addressed in the SELinux project through commit 2d35fcc. The fix modifies the cil_reset_perm function in libsepol/cil/src/cil_reset_ast.c to properly destroy the classperms list rather than simply resetting it, preventing the use-after-free condition.

Distribution-specific patches are available:

  • Fedora Package Announcement
  • Debian LTS Security Update
  • NetApp Security Advisory NTAP-20250207-0004

Workarounds

  • Limit CIL compiler access to trusted users and processes only
  • Implement input validation and sandboxing for policy compilation in automated workflows
  • Use SELinux module compilation in isolated environments when processing untrusted input
  • Consider disabling CIL-based policy compilation if not required for operations
bash
# Check current SELinux/libsepol version
rpm -qa | grep libsepol
dpkg -l | grep libsepol

# Update to patched version (RHEL/Fedora)
sudo dnf update libsepol

# Update to patched version (Debian/Ubuntu)
sudo apt update && sudo apt upgrade libsepol1

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/TechSelinux

  • SeverityLOW

  • CVSS Score3.3

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-416
  • Technical References
  • GitHub OSS-Fuzz Vulnerability OSV-2021-421

  • Fedora Package Announcement

  • Debian LTS Security Update

  • NetApp Security Advisory NTAP-20250207-0004
  • Vendor Resources
  • Chromium OSS-Fuzz Issue #31124

  • GitHub SELinux Commit 2d35fcc
  • Related CVEs
  • CVE-2021-36084: SELinux Use-After-Free Vulnerability

  • CVE-2021-36087: SELinux 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