@@ -111,6 +111,14 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
111111 Added the *text * parameter, as a more understandable alias of *universal_newlines *.
112112 Added the *capture_output * parameter.
113113
114+ .. versionchanged :: 3.8.17
115+
116+ Changed Windows shell search order for ``shell=True ``. The current
117+ directory and ``%PATH% `` are replaced with ``%COMSPEC% `` and
118+ ``%SystemRoot%\System32\cmd.exe ``. As a result, dropping a
119+ malicious program named ``cmd.exe `` into a current directory no
120+ longer works.
121+
114122.. class :: CompletedProcess
115123
116124 The return value from :func: `run `, representing a process that has finished.
@@ -459,6 +467,14 @@ functions.
459467 *executable * parameter accepts a bytes and :term: `path-like object `
460468 on Windows.
461469
470+ .. versionchanged :: 3.8.17
471+
472+ Changed Windows shell search order for ``shell=True ``. The current
473+ directory and ``%PATH% `` are replaced with ``%COMSPEC% `` and
474+ ``%SystemRoot%\System32\cmd.exe ``. As a result, dropping a
475+ malicious program named ``cmd.exe `` into a current directory no
476+ longer works.
477+
462478 *stdin *, *stdout * and *stderr * specify the executed program's standard input,
463479 standard output and standard error file handles, respectively. Valid values
464480 are :data: `PIPE `, :data: `DEVNULL `, an existing file descriptor (a positive
@@ -1077,6 +1093,14 @@ calls these functions.
10771093 .. versionchanged :: 3.3
10781094 *timeout * was added.
10791095
1096+ .. versionchanged :: 3.8.17
1097+
1098+ Changed Windows shell search order for ``shell=True ``. The current
1099+ directory and ``%PATH% `` are replaced with ``%COMSPEC% `` and
1100+ ``%SystemRoot%\System32\cmd.exe ``. As a result, dropping a
1101+ malicious program named ``cmd.exe `` into a current directory no
1102+ longer works.
1103+
10801104.. function :: check_call(args, *, stdin=None, stdout=None, stderr=None, \
10811105 shell=False, cwd=None, timeout=None, \
10821106 **other_popen_kwargs)
@@ -1107,6 +1131,14 @@ calls these functions.
11071131 .. versionchanged :: 3.3
11081132 *timeout * was added.
11091133
1134+ .. versionchanged :: 3.8.17
1135+
1136+ Changed Windows shell search order for ``shell=True ``. The current
1137+ directory and ``%PATH% `` are replaced with ``%COMSPEC% `` and
1138+ ``%SystemRoot%\System32\cmd.exe ``. As a result, dropping a
1139+ malicious program named ``cmd.exe `` into a current directory no
1140+ longer works.
1141+
11101142
11111143.. function :: check_output(args, *, stdin=None, stderr=None, shell=False, \
11121144 cwd=None, encoding=None, errors=None, \
@@ -1162,6 +1194,14 @@ calls these functions.
11621194 .. versionadded :: 3.7
11631195 *text * was added as a more readable alias for *universal_newlines *.
11641196
1197+ .. versionchanged :: 3.8.17
1198+
1199+ Changed Windows shell search order for ``shell=True ``. The current
1200+ directory and ``%PATH% `` are replaced with ``%COMSPEC% `` and
1201+ ``%SystemRoot%\System32\cmd.exe ``. As a result, dropping a
1202+ malicious program named ``cmd.exe `` into a current directory no
1203+ longer works.
1204+
11651205
11661206.. _subprocess-replacements :
11671207
0 commit comments