CVE-2023-24816: IPython Command Injection Vulnerability
Summary
CVE-2023-24816: IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language. Affects ipython across 2 version ranges.
< 8.10.0
< 385d69325319a5972ee9b5983638e3617f21cb1f
Fixed in 385d69325319a5972ee9b5983638e3617f21cb1f. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
IPython is an interactive computing environment that supports multiple programming languages, primarily Python. It provides a rich toolkit for interactive computing, including features like dynamic introspection, rich media, and shell access. However, certain versions of IPython prior to 8.1.0 are vulnerable to a command injection issue that can be exploited under specific conditions.
Vulnerability Detail
The vulnerability arises from the function IPython.utils.terminal.set_term_title, which can be exploited when called in a Windows environment where the ctypes library is unavailable. This situation allows an attacker to inject shell commands into the current process, limited to its scope. The risk is particularly relevant for users who utilize IPython as a library, as it can be invoked with untrusted input, leading to potential command execution vulnerabilities.
How To Fix
Minimum fixed version
385d69325319a5972ee9b5983638e3617f21cb1f
This is the first release that contains the fix.
pip install --upgrade "ipython==385d69325319a5972ee9b5983638e3617f21cb1f"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading is not immediately possible, users should ensure that any calls to the IPython.utils.terminal.set_term_title function are made with trusted or filtered input to mitigate the risk of command injection.
Conclusion
The command injection vulnerability in IPython (CVE-2023-24816) poses a significant risk for users, particularly those utilizing IPython as a library. It is crucial to upgrade to the patched version or implement workarounds to mitigate potential exploitation.
See every vulnerability recorded for ipython →
FAQ
Versions of IPython prior to 8.1.0 are affected by this command injection vulnerability.
The vulnerability allows an attacker to inject shell commands into the current process when untrusted input is passed to the set_term_title function.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
If an upgrade is not feasible, ensure that any input to the set_term_title function is trusted or filtered to prevent command injection.
Yes, Vulert can monitor and alert in real-time for open-source vulnerabilities in your software using just the Pipfile.lock.
Related vulnerabilities
Recent vulnerabilities recorded for ipython.