question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Security issue in pipx caused by misstyping command names

See original GitHub issue

Initially sent as email to @cs01, but reposting here per his request. The initial report was:

I’ve noticed that pipx is vulnerable to RCE if someone misstypes a command. I did type pipx upgrade_all out of mistake and if pypi would have had an upgrade_all package pipx would download and run it. I realize this is a “feature”, but I do not think a simple typo in the command arguments like this should cause an issue. What do you think about moving pipx BINARY towards pipx run BINARY, in this case the intent is explicit and it is clearer that BINARY will download something and the changes for typos are less.


I realize that it is kinda weird to call this a security issue since pipx does download and execute software anyways, but it would be nice to guard against simple typos nevertheless.

Another option, suggested by @cs01 in our conversation, would be to add code to detect typos and then prevent execution unless --force (or similar) is passed. From a pure technical point I think introducing run would be easier and less error prone.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

9reactions
cs01commented, Jan 18, 2019

Option 1: replace pipx BINARY with pipx run BINARY

(please vote with thumbs up/down)

7reactions
cs01commented, Jan 22, 2019

Looks like we have a winner 🎉. @apollo13 thanks for bringing this up. I will implement it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - pipx
Troubleshooting. reinstall-all fixes most issues. The following command should fix many problems you may encounter as a pipx user: pipx reinstall-all.
Read more >
Changelog - pip documentation v22.3.1
Add pip inspect command to obtain the list of installed distributions and other ... Fix pip install issues using a proxy due to...
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module to create and manage separate virtual environments for your Python ...
Read more >
Installing stand alone command line tools
pipx only works with Python 3.6+. pipx is installed with pip: Unix/macOS. python3 -m pip install --user pipx python3 ...
Read more >
pipx · PyPI
Despite the name, they do not necessarily contain binary data. ... For example, pipx install cowsay makes the cowsay command available ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found