CVE-2023-24816: set_term_title command injection in ipython

Published Feb 10, 2023
·
Updated

IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language. 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.settermtitle be called on Windows in a Python environment where ctypes is not available. The dependency on ctypes in IPython.utils.processwin32 prevents the vulnerable code from ever being reached in the ipython binary. However, as a library that could be used by another tool settermtitle 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 current process and limited to the scope of the current process. Users of ipython as a library are advised to upgrade. Users unable to upgrade should ensure that any calls to the IPython.utils.terminal.settermtitle function are done with trusted or filtered input.

Other sources

IPython could allow a local attacker to execute arbitrary commands on the system, caused by a flaw in the IPython.utils.terminal.settermtitle function. By sending a specially-crafted request with ctypes is not available, an attacker could exploit this vulnerability to execute arbitrary commands as current process on the system.

IBM

IPython provides an interactive Python shell and Jupyter kernel to use Python interactively. Versions prior to 8.10.0 are vulnerable to command injection in the settermtitle function under specific conditions. This has been patched in version 8.10.0.

Impact Users are only vulnerable when calling this function in Windows in a Python environment where ctypes is not available. The dependency on ctypes in IPython.utils.processwin32 prevents the vulnerable code from ever being reached (making it effectively dead code). However, as a library that could be used by another tool, settermtitle could introduce a vulnerability for dependencies. Currently settermtitle is only called with (semi-)trusted input that contain the current working directory of the current IPython session. If an attacker can control directory names, and manage to get a user to cd into this directory, then the attacker can execute arbitrary commands contained in the folder names.

GitHub

Affected Software

6 affected componentsFixes available
pip/ipython<8.10.0
8.10.0
IBM Cognos Analytics<=12.0.0-12.0.3
IBM Cognos Analytics<=11.2.0-11.2.4 FP4
IPython IPython<8.10.0
All of the following
IPython IPython<8.10.0
Microsoft Windows

Event History

Feb 10, 2023
CVE Published
via MITRE·07:52 PM
Data Sourced
via MITRE·07:52 PM
DescriptionSeverityWeakness
Advisory Published
07:55 PM

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-24816?

CVE-2023-24816 is a vulnerability that allows for command injection in the `set_term_title` function in IPython.

2

What is the severity of CVE-2023-24816?

CVE-2023-24816 has a severity level of 7 (high).

3

How does CVE-2023-24816 affect IPython?

Versions of IPython prior to 8.10.0 are affected by CVE-2023-24816.

4

How can I fix CVE-2023-24816?

To fix CVE-2023-24816, upgrade to IPython version 8.10.0 or later.

5

Are there any references for CVE-2023-24816?

Yes, you can find more information about CVE-2023-24816 in the following references: [Reference 1](https://github.com/ipython/ipython/security/advisories/GHSA-29gw-9793-fvw7), [Reference 2](https://github.com/ipython/ipython/commit/385d69325319a5972ee9b5983638e3617f21cb1f), [Reference 3](https://github.com/ipython/ipython/commit/991849c247fc208628879e7ca2923b3c218a5a75).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203