Message388300
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. |
|
Date |
User |
Action |
Args |
2021-03-08 20:32:28 | vstinner | set | recipients:
+ vstinner, christian.heimes, steve.dower, pablogsal |
2021-03-08 20:32:28 | vstinner | set | messageid: <1615235548.58.0.659993767767.issue43439@roundup.psfhosted.org> |
2021-03-08 20:32:28 | vstinner | link | issue43439 messages |
2021-03-08 20:32:28 | vstinner | create | |
|