malicious entry points can be installed from *any* python package

Bug #1575328 reported by Morgan Fainberg
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Won't Fix
Low
Unassigned
stevedore
New
Low
Unassigned

Bug Description

With the way some projects consume stevedore (notably openstackclient) where entry points are loaded automatically, it is possible that *any* python package to install a malicious entrypoint that could modify/consume/expose/steal/etc just about any data that is passed through the client (due to the way that python works).

This is effectively a similar problem to the ld.so.preload with C programs on linux.

Based upon limited discussions it would be nice to allow a consumer of stevedore to provide a mechanism to "white-list" libraries. This is only one option proposed. :Likely the discussion is going to be more in depth.

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

This is likely an Class B2 type bug [1], based on bad architecture. Likely this needs an OSSN, which is published shortly after the bug is made public. I expect this bug will not remain private too terribly long.

[1] https://security.openstack.org/vmt-process.html#incident-report-taxonomy

Revision history for this message
Jeremy Stanley (fungi) wrote :

Also the VMT is currently neither covering stevedore nor python-openstackclient, though we're happy to provide guidance on triage and messaging as time allows.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

Two thoughts on mitigation:

1. We could unset any auth-related environment variables before loading commands when help (the only case when we indiscriminately load code, afaict) to hide the values from plugins, which would then need to ask the app for an auth handle and we don't let them do that during help.
2. We could add a check using the EnabledExtensionManager to require plugins to be installed into the global site-packages (or more flexibly, into the same site-packages where python-openstackclient is installed).

I agree with Morgan that we should also document this.

Revision history for this message
Jeremy Stanley (fungi) wrote :

I'm unsure hiding the calling environment would solve anything. If the risk is that foo --help may load an untrusted (yet, for some reason, installed) entrypoint and run arbitrary code it provides, it's still a vector to modify dotfiles in the homedir, inspect files readable by that user, et cetera. Easy enough for it to leave behind a trap at that point to send interesting envvars to the attacker after the next login.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

I'm inclined to say this is working as designed and just document it, but I don't want that documentation to be alarmist. I'm open to suggestions on wording if someone wants to propose something.

Changed in python-stevedore:
importance: Undecided → Low
Changed in python-openstackclient:
importance: Undecided → Low
Jeremy Stanley (fungi)
information type: Private Security → Public
Artem Goncharov (gtema)
Changed in python-openstackclient:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.