logo

PEP 829 Makes Python Startup Safer, But Risk Remains

ID: 9a111470-02fb-5467-877a-4ff0168d3d1f

STIX ID: report--9a111470-02fb-5467-877a-4ff0168d3d1f

Feed Name: Checkmarx Zero

Threat Score
65/100

Date Published: 2026-10-15

Date Updated: 2026-10-16

Author: Bruno Dias

...
...

This report reviews Python PEP 829, which replaces dangerous .pth files with .start files to limit arbitrary exec at interpreter startup, and demonstrates that while the new format improves auditability it does not eliminate startup code execution. The author provides proofs-of-concept showing how .pth/.start entrypoint handling can be manipulated (including clearing shared entrypoint state to force .pth exec), explains attack implications for supply-chain persistence and startup abuse, and recommends mitigations such as using python -S, auditing site-packages, and using sys.addaudithook.

Your team is not currently subscribed to this feed. You must subscribe to it in order to see this post.