Skip to content

Commit

Permalink
Merge pull request from GHSA-29gw-9793-fvw7
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Feb 10, 2023
2 parents e548ee2 + 991849c commit 385d693
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion IPython/__init__.py
Expand Up @@ -63,7 +63,7 @@
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"}


def embed_kernel(module=None, local_ns=None, **kwargs):
Expand Down
32 changes: 8 additions & 24 deletions IPython/utils/terminal.py
Expand Up @@ -91,30 +91,14 @@ def _restore_term_title_xterm():
_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
SetConsoleTitleW.argtypes = [ctypes.c_wchar_p]

def _set_term_title(title):
"""Set terminal title using ctypes to access the Win32 APIs."""
SetConsoleTitleW(title)


def set_term_title(title):
Expand Down
12 changes: 12 additions & 0 deletions docs/source/whatsnew/version8.rst
Expand Up @@ -2,6 +2,18 @@
8.x Series
============


IPython 8.9.1
-------------

Out of schedule release of IPython with minor fixes to patch a potential CVE-2023-24816.
This is a really low severity CVE that you most likely are not affected by unless:

- You are on windows.
- You have a custom build of Python without ``_ctypes``
- You cd or start IPython or Jupyter in untrusted directory which names may be valid shell commands.


.. _version 8.9.0:

IPython 8.9.0
Expand Down

0 comments on commit 385d693

Please sign in to comment.