This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients christian.heimes, pablogsal, steve.dower, vstinner
Date 2021-03-08.20:32:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615235548.58.0.659993767767.issue43439@roundup.psfhosted.org>
In-reply-to
Content
It is currently possible to discover the internal list of audit hooks using gc module functions, like gc.get_objects(), and so remove an audit hooks, whereas it is supposed to not be possible. The PEP 578 states: "Hooks cannot be removed or replaced."

Rather than attempting to fix this specific vulnerability, I suggest to add new audit events on the following gc functions:

* gc.get_objects()
* gc.get_referrers()
* gc.get_referents()

These functions are "dangerous" since they can expose Python objects in an inconsistent state. In the past, we add multiple bugs related to "internal" tuples which were not fully initialized (but already tracked by the GC). See bpo-15108 for an example.

Note: if someone wants to address the ability to remove an audit hook, the internal list can be modified to not be a Python object.
History
Date User Action Args
2021-03-08 20:32:28vstinnersetrecipients: + vstinner, christian.heimes, steve.dower, pablogsal
2021-03-08 20:32:28vstinnersetmessageid: <1615235548.58.0.659993767767.issue43439@roundup.psfhosted.org>
2021-03-08 20:32:28vstinnerlinkissue43439 messages
2021-03-08 20:32:28vstinnercreate