Run a command string via the system shell (shell=True). Only use this for cases that intentionally require shell features (e.g., user-defined hooks with pipes/redirects). Never pass untrusted/user-controlled values into *cmd*. Related: CWE-78 (OS Command Injection), https://git
(cmd: str, env: Mapping[str, str] | None = None)
| 93 | |
| 94 | |
| 95 | def run_shell(cmd: str, env: Mapping[str, str] | None = None) -> Command: |
| 96 | """Run a command string via the system shell (shell=True). |
| 97 | |
| 98 | Only use this for cases that intentionally require shell features |
| 99 | (e.g., user-defined hooks with pipes/redirects). Never pass |
| 100 | untrusted/user-controlled values into *cmd*. |
| 101 | |
| 102 | Related: CWE-78 (OS Command Injection), |
| 103 | https://github.com/commitizen-tools/commitizen/issues/1918 |
| 104 | """ |
| 105 | return _popen(cmd, shell=True, env=env) |
| 106 | |
| 107 | |
| 108 | def run_interactive( |