You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security and usability improvement for webbrowser.open() on macOS: Replace osascript with /usr/bin/open #148472
We should modernize the macOS implementation of webbrowser.open() by replacing the legacy osascript-based code with Apple’s purpose-built /usr/bin/open utility.
Current Issues
The existing MacOSXOSAScript class builds a short AppleScript and executes it via osascript.
Usability Concerns
On managed enterprise Macs (using MDM/EDR tools such as CrowdStrike, SentinelOne, Jamf, or Santa), osascript is often monitored or restricted due to its abuse in malware campaigns. When this happens, webbrowser.open() fails silently or with unclear errors, breaking a simple, commonly used API for developers and applications.
Security Risk osascript is a general-purpose scripting interpreter and a classic Living-Off-the-Land binary (LOOBin). It was part of the macOS payload in the recent Axios npm supply-chain attack (March 31, 2026). Even after the PATH-lookup fix, it still requires constructing and executing AppleScript, a more powerful mechanism than needed just to open a URL. This increases the stdlib attack surface and ties Python to a binary that security teams frequently treat with caution.
Activity
picnixz commentedon Apr 12, 2026
The discussion is empty, wait for a consensus to be reached.