Get Set, Exploit - Unveiling Python Class Pollution In the Wild
Where
Main Stage
DEF CON 34
Duration
38 min
Introduces a six-type taxonomy of Python class pollution, an automated static analysis tool, and dozens of zero-day exploits found across popular packages.
Summary
The talk opens with Python's object model, where everything is an object linked by references and dunder attributes. Dynamic reflection such as getattr and setattr lets attacker-supplied keys walk that graph, so a recursive updater can reach classes, modules and secrets far beyond the object it was meant to touch. The speakers trace the history from a 2023 blog post to a 2024 PyTorch Lightning CVE, arguing that those were only the visible part.
The core contribution is a taxonomy built from two get primitives and three set primitives, yielding six pollution types, of which only one was previously known. The team then built Pyrl, which applies a new static analysis called operational taint analysis. Run across more than 600,000 GitHub and PyPI packages, it produced 886 alerts, and the researchers report 47 exploitable zero-days in projects including Azure CLI, Taipy and ComfyUI.
Case studies show how these flaws become serious. In Django Unicorn, an unauthenticated state-update API allowed denial of service, cross-site scripting through BeautifulSoup's sanitization table, forged signing secrets, and remote code execution. A second case, in TypeY, started from a weak constrained primitive and needed a race condition to reach eval. The takeaway for developers is to restrict which attributes can be traversed and to validate the final target before any assignment.
Materials
Related talks
Main Stage·34 min
James Arnott
Shows how a Belgian eID signing browser extension let any website read smart card data, leak PIN tokens and reach drive-by code execution.
Main Stage·38 min
Thomas Stacey · Tobia Righi
Shows how CRLF header injection behind NGINX proxies can be escalated into HTTP request smuggling, from cache poisoning to browser-driven account takeover.
Main Stage·32 min
Oleksandr Mirosh
Shows how turning a plain string into a typed .NET object can lead to remote code execution, with no serializer involved.


