Privilege Escalation: Hijacking Python Library

From time to time, you may come across a scenario where a system has misconfigured permissions in their Python library. Generally, directories that house Python modules have permissions set so that modifications can’t be made without elevated privileges. With that, there are a number of ways that users can create this vulnerability:

  1. The user creates their own Python module and forgets to restrict write access to it.
  2. The user decides to lessen restrictions within the Python library directory.