os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
def _open_in_editor(path: Path): editor = os.environ.get("EDITOR", "nano") os.system(f'{editor} "{path}"') # ── Commands ─────────────────────────────────────────────────────────────────- Confidence
- 98% confidence
- Finding
- The code invokes `os.system()` with a command string built from the `EDITOR` environment variable, which is interpreted by the shell. Because `EDITOR` is attacker-controllable in many execution contexts, this enables arbitrary command execution, not just launching an editor; quoting only the path does not protect the command prefix.
