TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Exploiting a Use-After-Free for code execution in every version of Python 3

35 pointsby yasoobabout 3 years ago

1 comment

cwalvabout 3 years ago
This is a pretty long article that should have started with the last section:<p>&gt; So what?<p>&gt; What’s the point of this whole thing, can’t you just do os.system(...)? Well, yes.<p>&gt; Given that you need to be able to execute arbitary Python code in the first place, this exploit won’t be useful in most settings. However, it may be useful in Python interpreters which are attempting to sandbox your code, through restricting imports or use of Audit Hooks, for example. This exploit doesn’t use any imports and doesn’t create any code objects, which will fire import and code.__new__ hooks, respectively. My exploit will only trigger a builtin.__id__ hook event, which is much more likely to be permitted.
评论 #31385322 未加载