Python Import as an Execution Boundary: An Empirical Study of Bugs, Vulnerabilities, and Analysis Gaps
Baihong Chen, Wen Li
Key points
From the paper's conclusion- We retain 31 import-related advisory vulnerabilities and 38 application-data boundary cases and confirm 1,429 project-history bugs across 1,302 repositories.
Abstract
Python import does more than resolve dependencies: it executes code during module and package initialization. This behavior can trigger failures, load dynamic or native code, access resources, or change security-sensitive state before an application calls a package API. Prior work studies package selection, malicious packages, or package vulnerabilities. We present ImportMine, a study of import-related bugs and security vulnerabilities in Python software. We combine security advisories with PyPI project histories and use source and patch evidence to confirm how import activates cases, why the problem occurs, how developers fix it, and what program information is needed to explain the behavior. We retain 31 import-related advisory vulnerabilities and 38 application-data boundary cases and confirm 1,429 project-history bugs across 1,302 repositories. Among the project-history bugs activated during initialization, 97.6% stop or disrupt normal execution. In contrast, 90.0% of the 20 initialization- activated advisory vulnerabilities are High or Critical. Module-level code and package initialization activate 98.3% of the analyzed history cases. Dynamic loading is much less common, but most of its cases perform security-sensitive actions. We also find that many fixes change when an import becomes active instead of removing the dependency. Finally, we derive ImportVulBench, 228 paired pre-fix and fixed programs covering all 11 bug types.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- CrossPloit: A Benchmark for Cross-Version PoC Migration in Python Web ApplicationsarXiv · 2026
- Preflight: Agentic Last-Mile Verification for AI Software Supply ChainsarXiv · 2026
- Beyond Crash-to-Patch: Patch Evolution for Linux Kernel RepairarXiv · 2026
- SIExBench: A Benchmark for Automated Repair of Sensitive Information ExposurearXiv · 2026
- Silence of Commit Messages: An Empirical Study for Vulnerability Commit Message Generation using Large Language ModelsProceedings of the ACM on Software Engineering · 2026
- PyCache Trap: The Inspection-Execution Gap in Agent Skill ScannersarXiv · 2026