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-2022-21699

CVE-2022-21699: IPython Arbitrary Code Execution Vulnerability

CVE-2022-21699 is a remote code execution vulnerability in IPython that allows users to execute arbitrary code as other users through improper temporary file management. This article covers technical details, impact, and mitigation.

Published: February 18, 2026

CVE-2022-21699 Overview

IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language. CVE-2022-21699 affects IPython installations where improper management of cross-user temporary files enables arbitrary code execution. This vulnerability allows one user to run code as another user on the same machine, representing a significant local privilege escalation risk in multi-user environments.

The vulnerability stems from insecure handling of configuration file paths, where IPython would include the current working directory in its configuration file search path. An attacker with local access could place a malicious configuration file in a shared directory, which would then be loaded when another user starts IPython from that location.

Critical Impact

Local attackers can achieve arbitrary code execution as another user, enabling privilege escalation and unauthorized system access on multi-user systems.

Affected Products

  • IPython versions prior to 8.0.1
  • Debian Linux 9.0, 10.0, and 11.0
  • Fedora 34 and 35

Discovery Timeline

  • 2022-01-19 - CVE-2022-21699 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-21699

Vulnerability Analysis

CVE-2022-21699 is an arbitrary code execution vulnerability caused by improper privilege management (CWE-269) and execution with unnecessary privileges (CWE-250). The core issue lies in how IPython handles configuration file discovery during startup.

When IPython initializes, it searches for configuration files in multiple locations. Prior to the security fix, the application would include the current working directory (os.getcwd()) as a default configuration file path. This behavior becomes dangerous in multi-user environments where users might run IPython from shared directories such as /tmp, project directories, or network shares.

An attacker could exploit this by placing a malicious IPython configuration file (such as ipython_config.py) in a directory where other users are likely to launch IPython. When a victim user starts IPython from that directory, the malicious configuration would be loaded and executed with the victim's privileges.

Root Cause

The vulnerability originates from the _config_file_paths_default method in IPython/core/application.py. This method returned [os.getcwd()] as the default configuration file search path, causing IPython to automatically trust and load configuration files from the current working directory regardless of ownership or permissions.

This design flaw violates the principle of least privilege by trusting user-controllable file locations for security-sensitive configuration loading.

Attack Vector

The attack requires local access to the target system. An attacker with a low-privileged account can exploit this vulnerability without any user interaction beyond the victim starting IPython in a directory containing the attacker's malicious configuration file.

Exploitation Scenario:

  1. Attacker identifies a shared directory where other users run IPython (e.g., /tmp, shared project folder)
  2. Attacker creates a malicious ipython_config.py file in that directory
  3. Victim user navigates to the shared directory and launches IPython
  4. IPython loads the attacker's configuration file, executing arbitrary Python code with the victim's privileges

The following patch removes the vulnerable default configuration path:

python
     config_file_paths = List(Unicode())
     @default('config_file_paths')
     def _config_file_paths_default(self):
-        return [os.getcwd()]
+        return []
 
     extra_config_file = Unicode(
     help="""Path to an extra config file to load.

Source: GitHub Commit

Additionally, the patch added CVE tracking to the IPython codebase:

python
 __license__  = release.license
 __version__  = release.version
 version_info = release.version_info
+# list of CVEs that should have been patched in this release.
+# this is informational and should not be relied upon.
+__patched_cves__ = {"CVE-2022-21699"}
+
 
 def embed_kernel(module=None, local_ns=None, **kwargs):
     """Embed and start an IPython kernel in a given scope.

Source: GitHub Commit

Detection Methods for CVE-2022-21699

Indicators of Compromise

  • Presence of unexpected ipython_config.py or ipython_config.json files in shared directories like /tmp, /var/tmp, or common project directories
  • IPython configuration files owned by different users than those running IPython
  • Unusual process execution originating from IPython sessions, particularly network connections or file access outside normal patterns
  • Configuration files in shared directories with recent modification timestamps

Detection Strategies

  • Monitor for creation of IPython configuration files in world-writable or shared directories using file integrity monitoring tools
  • Implement process ancestry tracking to detect unusual child processes spawned from IPython instances
  • Use application whitelisting to detect when IPython loads configuration from non-standard paths
  • Deploy endpoint detection rules that alert on ipython_config.py file creation in directories outside user home folders

Monitoring Recommendations

  • Enable file access auditing on shared directories to detect potential staging of malicious configuration files
  • Monitor IPython process execution context, particularly when launched from shared or temporary directories
  • Implement SentinelOne Singularity platform for behavioral detection of suspicious code execution patterns originating from Python interpreters
  • Review system logs for IPython sessions initiated from unusual working directories

How to Mitigate CVE-2022-21699

Immediate Actions Required

  • Upgrade IPython to version 8.0.1 or later immediately on all affected systems
  • Audit shared directories for suspicious IPython configuration files and remove any unauthorized files
  • Review user activity logs for any signs of exploitation or privilege escalation
  • Consider restricting IPython execution to user home directories in high-security environments

Patch Information

The vulnerability is fixed in IPython version 8.0.1. The fix removes the current working directory from the default configuration file search path, preventing IPython from automatically loading potentially untrusted configuration files.

Patch details are available in the GitHub Security Advisory and the IPython 8.0.1 Release Notes.

Distribution-specific updates are available for Debian and Fedora.

Workarounds

  • Avoid running IPython from shared or world-writable directories until the patch is applied
  • Set the IPYTHONDIR environment variable to explicitly specify a trusted configuration directory before launching IPython
  • Remove write permissions for other users from directories where IPython is commonly executed
  • Use Python virtual environments with isolated IPython installations to minimize exposure
bash
# Set explicit IPython configuration directory
export IPYTHONDIR="${HOME}/.ipython"

# Verify no suspicious config files exist in current directory before launching
ls -la ipython_config.* 2>/dev/null && echo "WARNING: Config file found in current directory"

# Launch IPython only after verification
ipython

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechIpython

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability1.46%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-250

  • CWE-269
  • Technical References
  • GitHub Security Advisory

  • IPython Release Notes

  • Debian LTS Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement
  • Vendor Resources
  • GitHub Commit Update
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal 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