2017 Python Language Summit: Lightning Talks
lwn.net
lwn.net
Even if Python isn't there, Perl or PHP, or something else similarly flexible probably is. Or just curl and bash.
Edit: Regarding this: "So, what should be done about this? The Python core development community needs to acknowledge the problem; it is the reason that many corporate networks ban Python, for example"
I've never heard of this...is this actually common? If I've already compromised your system, I can install whatever I want...one way or the other. Even if that's pasting binaries via base64.
But now, even bash has an optional TCP socket support, or you might have netcat installed etc, assuming that what you can get executed is minimal in size and you need to fetch something from the Internet.
Things like Python, bash, etc, when actively used make it harder to tell when unauthorized code is running, either via automated application whitelisting systems or more monitoring/hunting scenarios.
To developers, running arbitrary code is totally normal, but it makes securing developer systems particularly challenging, compared to the rest of a corporate network. I've never really met anyone who has a good answer for how to secure developer machines, the best that people usually manage is trying to make jumping from dev to prod as hard as possible.
Which sort of brings us back to the point: in a prod system, you only want to be running the code that is coming out of your repo & upstream, nothing else, having a python interpreter there makes that harder than a bash shell since bash still largely has to call other binaries to do things, especially after you disable bash sockets.
And then you learn about bash loadable builtins and have a bad day ;-) (enable -f ...)
python -c "exec(urlopen(...).read())"Some shops do have a policy to not use any Python software at all (usually excluding a bunch of other stuff as well).
Admittedly, in the given examples, the attacks are not especially interesting, but that is because it is totally unsurprising that a Python interpreter might have this kind of power.
There are distros like NixOS where there is not a system Python preinstalled, this is due to NixOS following the Principle of Least Authority (POLA) and not putting powerful tools into standard paths automatically.
I want to like it & use it, after all JRuby is an excellent example of what can be done. It's just every time I've tried, I've just found myself deep in the guts of various libraries trying to make it work.