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-2023-24816

CVE-2023-24816: IPython Command Injection RCE Vulnerability

CVE-2023-24816 is a command injection RCE vulnerability in IPython affecting versions prior to 8.1.0 on Windows systems. Attackers can inject shell commands through untrusted input. This article covers technical details, affected versions, impact, and mitigation steps.

Published: February 4, 2026

CVE-2023-24816 Overview

IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages. Versions prior to 8.1.0 are subject to a command injection vulnerability with very specific prerequisites. This vulnerability requires that the function IPython.utils.terminal.set_term_title be called on Windows in a Python environment where ctypes is not available.

The dependency on ctypes in IPython.utils._process_win32 prevents the vulnerable code from ever being reached in the ipython binary. However, as a library that could be used by another tool, set_term_title could be called and hence introduce a vulnerability. Should an attacker get untrusted input to an instance of this function they would be able to inject shell commands as the current process, limited to the scope of the current process.

Critical Impact

Command injection vulnerability in IPython library allows attackers to execute arbitrary shell commands when untrusted input reaches the set_term_title function on Windows systems without ctypes available.

Affected Products

  • IPython versions prior to 8.1.0
  • Microsoft Windows operating systems
  • Applications using IPython as a library that call set_term_title with untrusted input

Discovery Timeline

  • 2023-02-10 - CVE-2023-24816 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-24816

Vulnerability Analysis

This command injection vulnerability (CWE-78) with improper input validation (CWE-20) exists in the terminal title-setting functionality of IPython on Windows platforms. The vulnerability arises from a fallback code path that becomes active when the ctypes module is unavailable.

When ctypes is not available, the code falls back to using os.system("title " + title) to set the terminal title. This direct concatenation of user input with a shell command creates a classic command injection vector. An attacker who can control the title parameter can append shell metacharacters and additional commands that will be executed with the privileges of the running process.

The attack complexity is high because exploitation requires a specific environment where ctypes is unavailable, which is not the typical Python installation on Windows.

Root Cause

The root cause is improper input validation in the fallback code path of the _set_term_title function in IPython/utils/terminal.py. When ctypes cannot be imported, the code uses direct shell command execution via os.system() with unsanitized user input. This violates secure coding principles by trusting external input in a security-sensitive operation.

The vulnerable pattern was:

python
os.system("title " + title)

This allows shell metacharacters in the title parameter to break out of the intended command and execute arbitrary commands.

Attack Vector

The attack requires local access and specific conditions: the attacker must be able to provide input to the set_term_title function on a Windows system where ctypes is not available. The attacker could inject shell commands by providing a malicious title string containing command separators such as & or | followed by malicious commands.

For example, an input like test & whoami would execute both the title command and the injected whoami command.

The security patch removes the vulnerable fallback code path entirely, making ctypes a hard requirement:

python
# Security patch in IPython/utils/terminal.py
# Source: https://github.com/ipython/ipython/commit/385d69325319a5972ee9b5983638e3617f21cb1f

         _set_term_title = _set_term_title_xterm
         _restore_term_title = _restore_term_title_xterm
 elif sys.platform == 'win32':
-    try:
-        import ctypes
-
-        SetConsoleTitleW = ctypes.windll.kernel32.SetConsoleTitleW
-        SetConsoleTitleW.argtypes = [ctypes.c_wchar_p]
-    
-        def _set_term_title(title):
-            """Set terminal title using ctypes to access the Win32 APIs."""
-            SetConsoleTitleW(title)
-    except ImportError:
-        def _set_term_title(title):
-            """Set terminal title using the 'title' command."""
-            global ignore_termtitle
-
-            try:
-                # Cannot be on network share when issuing system commands
-                curr = os.getcwd()
-                os.chdir("C:")
-                ret = os.system("title " + title)
-            finally:
-                os.chdir(curr)
-            if ret:
-                # non-zero return code signals error, don't try again
-                ignore_termtitle = True
+    import ctypes
+
+    SetConsoleTitleW = ctypes.windll.kernel32.SetConsoleTitleW

Source: GitHub Commit Details

Detection Methods for CVE-2023-24816

Indicators of Compromise

  • Unusual process spawning from Python processes on Windows systems
  • Unexpected shell commands executed following terminal title operations
  • Evidence of os.system() calls with suspicious title parameters in application logs
  • Process creation events showing command injection patterns with &, |, or ; characters

Detection Strategies

  • Monitor for Python applications calling os.system() with user-controlled input containing shell metacharacters
  • Implement application-level logging for all calls to IPython.utils.terminal.set_term_title
  • Use endpoint detection to identify suspicious child process creation from Python interpreters
  • Deploy static analysis tools to identify vulnerable IPython versions in your codebase

Monitoring Recommendations

  • Enable process creation auditing on Windows systems running Python applications
  • Monitor for unusual command patterns following title commands in command-line logs
  • Implement alerting for applications using IPython versions prior to 8.1.0
  • Review application dependencies to identify any usage of the vulnerable set_term_title function

How to Mitigate CVE-2023-24816

Immediate Actions Required

  • Upgrade IPython to version 8.1.0 or later immediately
  • Audit all applications using IPython as a library for calls to set_term_title
  • Ensure all Python environments on Windows have ctypes available
  • Implement input validation for any user-controlled data passed to terminal functions

Patch Information

The vulnerability has been patched in IPython version 8.1.0. The fix removes the vulnerable fallback code path that used os.system() and makes ctypes a hard requirement for setting terminal titles on Windows. The patch commit (385d69325319a5972ee9b5983638e3617f21cb1f) updates the __patched_cves__ set to include CVE-2023-24816:

python
# Security patch in IPython/__init__.py
# Source: https://github.com/ipython/ipython/commit/385d69325319a5972ee9b5983638e3617f21cb1f

 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"}
+__patched_cves__ = {"CVE-2022-21699", "CVE-2023-24816"}

For more details, see the GitHub Security Advisory and the patch commit.

Workarounds

  • Ensure that any calls to IPython.utils.terminal.set_term_title are made with trusted or properly filtered input
  • Validate and sanitize all user input before passing to terminal-related functions
  • If upgrading is not immediately possible, ensure ctypes is available in your Python environment to prevent the vulnerable fallback path
  • Consider disabling terminal title functionality if not required by your application
bash
# Configuration example - Upgrade IPython to patched version
pip install --upgrade ipython>=8.1.0

# Verify installed version
pip show ipython | grep Version

# Check if ctypes is available in your Python environment
python -c "import ctypes; print('ctypes available')"

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechMicrosoft Windows

  • SeverityHIGH

  • CVSS Score7.0

  • EPSS Probability0.47%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-20

  • CWE-78
  • Technical References
  • GitHub Code Snippet

  • GitHub Code Snippet
  • Vendor Resources
  • GitHub Commit Details

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2023-3079: Google Chrome V8 RCE Vulnerability

  • CVE-2025-4660: Forescout SecureConnector RCE Vulnerability

  • CVE-2024-49117: Windows Hyper-V RCE Vulnerability

  • CVE-2022-28182: Nvidia GPU Display Driver RCE 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