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

CVE-2021-21696: Jenkins RCE Vulnerability via Agent Access

CVE-2021-21696 is a remote code execution vulnerability in Jenkins that allows attackers controlling agent processes to execute unsandboxed code on the controller. This article covers technical details, affected versions, and mitigations.

Published: February 25, 2026

CVE-2021-21696 Overview

CVE-2021-21696 is a critical remote code execution vulnerability affecting Jenkins 2.318 and earlier, as well as LTS 2.303.2 and earlier. The vulnerability exists due to improper access control in the FilePath APIs, which fail to limit agent read/write access to the libs/ directory inside build directories. This security flaw allows attackers who have compromised agent processes to replace trusted library code with malicious variants, ultimately resulting in unsandboxed code execution within the Jenkins controller process.

Critical Impact

Attackers with control over Jenkins agent processes can achieve arbitrary code execution on the Jenkins controller by replacing trusted library code, potentially compromising the entire CI/CD pipeline and associated infrastructure.

Affected Products

  • Jenkins 2.318 and earlier (weekly releases)
  • Jenkins LTS 2.303.2 and earlier (Long-Term Support releases)
  • All Jenkins installations using FilePath APIs with agent-to-controller file operations

Discovery Timeline

  • 2021-11-04 - CVE-2021-21696 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-21696

Vulnerability Analysis

This vulnerability stems from a fundamental access control weakness in Jenkins' FilePath API implementation. The FilePath APIs are designed to facilitate file operations between Jenkins agents and the controller. However, prior to the patch, these APIs did not properly restrict agent access to sensitive directories, specifically the libs/ directory within build directories.

The libs/ directory is particularly significant because it contains shared libraries that are trusted and executed within the Jenkins controller's security context. When pipeline builds execute, code from this directory runs without sandbox restrictions, making it a high-value target for attackers.

The attack scenario requires an adversary to first gain control of a Jenkins agent process. This could occur through compromised build scripts, malicious dependencies, or exploiting other vulnerabilities in the agent environment. Once an agent is compromised, the attacker can leverage the unrestricted FilePath APIs to write malicious code to the libs/ directory, replacing legitimate library files with weaponized versions.

Root Cause

The root cause of CVE-2021-21696 is insufficient access control enforcement in the Jenkins FilePath API implementation. The API fails to implement proper directory-level restrictions that would prevent agent processes from writing to sensitive controller directories. This represents a violation of the principle of least privilege, where agents should only have access to directories strictly necessary for their build operations.

The security model of Jenkins relies on a separation between agents (which execute potentially untrusted build code) and the controller (which manages administrative functions). This vulnerability breaks that security boundary by allowing agents to modify controller-side trusted code.

Attack Vector

The attack leverages network-accessible Jenkins installations where an attacker has gained control of an agent process. The exploitation flow involves:

  1. Compromising a Jenkins agent through malicious build code, supply chain attacks, or other vulnerabilities
  2. Using the FilePath APIs to enumerate and access the libs/ directory within build directories on the controller
  3. Replacing legitimate shared library code with malicious code containing attacker payloads
  4. Waiting for a pipeline or build job to execute the modified library code
  5. Achieving unsandboxed code execution in the Jenkins controller process context

The exploitation bypasses Jenkins' Groovy sandbox protections entirely because the modified library code is treated as trusted and executed without sandbox restrictions. This grants the attacker full access to the Jenkins controller's capabilities, including accessing credentials, modifying builds, and potentially pivoting to connected systems.

Detection Methods for CVE-2021-21696

Indicators of Compromise

  • Unexpected modifications to files within the libs/ directory of build workspaces
  • Anomalous file write operations originating from agent processes targeting controller directories
  • Unusual process behavior or network connections from the Jenkins controller process
  • Modified timestamps on shared library files that don't correspond to legitimate deployments

Detection Strategies

  • Monitor Jenkins audit logs for FilePath API operations targeting the libs/ directory from agent processes
  • Implement file integrity monitoring on the Jenkins controller's build directories, particularly the libs/ subdirectories
  • Deploy runtime application self-protection (RASP) solutions to detect unauthorized code modifications
  • Use SentinelOne's Singularity platform to detect anomalous process behavior on Jenkins infrastructure

Monitoring Recommendations

  • Enable comprehensive Jenkins audit logging and forward logs to a SIEM for correlation and analysis
  • Configure alerts for any file modifications in trusted library directories outside of expected deployment windows
  • Monitor Jenkins controller processes for unusual child process spawning or network activity
  • Implement baseline behavioral analysis for Jenkins infrastructure to identify deviations

How to Mitigate CVE-2021-21696

Immediate Actions Required

  • Upgrade Jenkins to version 2.319 or later (weekly) or LTS 2.303.3 or later immediately
  • Review Jenkins agent configurations and restrict which agents can connect to the controller
  • Audit recent builds and library modifications for signs of compromise
  • Consider temporarily disabling agents from untrusted environments until patching is complete

Patch Information

Jenkins has released security patches addressing this vulnerability. Organizations should upgrade to Jenkins 2.319 or later for weekly releases, or Jenkins LTS 2.303.3 or later for Long-Term Support installations. The fix implements proper access control restrictions on the FilePath APIs to prevent agents from accessing sensitive directories on the controller.

For detailed patch information and additional security advisories, refer to the Jenkins Security Advisory #SECURITY-2423.

Workarounds

  • Implement network segmentation to isolate Jenkins agents from the controller where possible
  • Use the Agent-to-Controller Security subsystem to restrict which operations agents can perform on the controller
  • Deploy application-level firewalls or proxies to monitor and filter FilePath API calls between agents and the controller
  • Consider running agents in ephemeral, isolated containers to limit the impact of agent compromise
bash
# Verify current Jenkins version
java -jar jenkins.war --version

# After upgrade, verify the new version is running
curl -s http://localhost:8080/api/json | grep -o '"version":"[^"]*"'

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechJenkins

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.95%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • NVD-CWE-Other
  • Technical References
  • Openwall OSS Security Discussion
  • Vendor Resources
  • Jenkins Security Advisory #SECURITY-2423
  • Related CVEs
  • CVE-2025-53652: Jenkins Git Parameter RCE Vulnerability

  • CVE-2025-31722: Jenkins Templating Engine RCE Vulnerability

  • CVE-2023-27899: Jenkins RCE Vulnerability via File Upload

  • CVE-2022-20617: Jenkins Docker Commons RCE Vulnerability
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