Use absolute paths when invoking built-in shell commands (original) (raw)

Bug report

Bug description:

On macOS, web browsers are opened via popen calling osascript.

cpython/Lib/webbrowser.py

Line 647 in3964f97

osapipe = os.popen("osascript", "w")

However, if a user has a colliding osascript executable earlier in their PATH, this may fail or cause unwanted behaviour.

Depending on one's environment or level of paranoia, this may be considered a security vulnerability.

CPython versions tested on:

CPython main branch, 3.13

Operating systems tested on:

macOS

Linked PRs