You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tested the exploit all the way back to 2.7.18 and have verified it's on literally everything, which means I can actively modify the internal functionality of any version of python from 2.7.18+
currently working on achieving:
deffunc(**kw):
print( kw.item )
have already achieved better inlining for dict updates: :)
classaccess(object): __slots__=(); __eq__=lambdai,o: od=dict.__dict__==access() # internal memory_init=dict.__init__# updates memory for d so we don't return None from d.update()_update=d.pop('update') orNone# ensures our memory exists for d.update when poppedd['update'] =lambdad,*a,**kw: _update(d,*a,**kw) or_init(d) orda= {}.update( key1='value1' ).update( key2='value2' ).update( key3='value3' )
print(a)
I intend to also use the exploit to patch the exploit, since clearly this needs to be fixed :)
here's a patch using the exploit that restores the intended functionality for property()
class access(object): __slots__=(); __eq__=lambda i,o: o
pd = property.__dict__ == access()
pd.pop('__init__') # fix property() so attributes are actually readonly
class A(object):
__slots__ = frozenset()
a = property(lambda i: 'test')
a = A()
#A.a.__init__(lambda i: 'failure')
print(a.a)
basically the patch shoves property.__init__ back into C space, since the function can't be GCd
what's returned instead when you access the attribute is object.__init__, which means you can't supply arguments to overwrite the readonly attributes fget, fset, and fdel. :)
Bug report
Bug description:
Or
Two things to note:
type("",(),{"__eq__":lambda s,o:o})() == dct
won't work.I don't know if I even want this to be patched, but I want to get it at least somewhat documented.
CPython versions tested on:
3.10, 3.12
Operating systems tested on:
No response
The text was updated successfully, but these errors were encountered: