Pysa: An open source static analysis tool to detect and prevent security issues in Python code

Introduced Pysa, an open-source static analysis tool for Python, built on top of the Pyre type checker. Pysa detects security and privacy issues by analyzing data flows, identifying sources and sinks to prevent issues like XSS, SQL injection, and improper user data disclosure. It has been applied to Instagram's Python codebase, providing rapid feedback to developers and security engineers. Pysa's open-source release includes definitions for taint analysis, enabling its use with common Python frameworks like Django and Tornado. The post also details Pysa's working mechanism, its handling of false positives and negatives through sanitizers and features, and its limitations related to the problem space, resource constraints, and Python's dynamic nature.
More from the Application Security and Permissions trail
- How We’re Building Scam Alert on WhatsApp With End-to-End Encryption and Verifiability Guarantees
- Privacy-Aware Infrastructure in the AI-Native Era: An Asset Classification Case Study
- Labyrinth 1.1: Making End-to-End Encrypted Backups Even More Reliable
- How Meta Is Strengthening End-to-End Encrypted Backups
- Post-Quantum Cryptography Migration at Meta: Framework, Lessons, and Takeaways