Steve Dower <steve.do...@python.org> added the comment:

> Maybe webbrowser must be changed to become *very strict*.

This is the only acceptable suggestion I've seen (since my suggestion ;) )

I'd propose making it very strict by *requiring* a browser to be detected. So 
remove the os.startfile default and always require Chrome/Edge/etc. to be 
found. If they're not, you get an exception.

Personally, I'd hate this behaviour :) But for my cases I'd just switch to 
os.startfile unconditionally (as I only use this in my own scripts and not 
libraries).

One other thing to factor in is that if you use os.startfile to launch a 
malicious program, it will first be scanned by any anti-malware or antivirus 
software, and likely also by Windows SmartScreen. So you're not exactly getting 
arbitrary execution. It also only runs in the context of the current user, so 
there's not necessarily any escalation here.

All in all, I'd label this a vulnerability in applications that use 
webbrowser.open(), rather than in webbrowser.open() itself. The function is 
doing exactly what it is told, and if someone is passing untrusted input, then 
they'll get the exact untrusted output they expect.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36021>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to