| library_name: pytorch | |
| tags: | |
| - security-research | |
| - modelscan-bypass | |
| license: mit | |
| # ModelScan Bypass PoC — site.addpackage | |
| Security research for responsible disclosure via Huntr MFV program. | |
| ## Vulnerability | |
| `site.addpackage` is not in modelscan's `unsafe_globals` blocklist. | |
| modelscan reports "No issues found" but loading triggers calls exec() on .pth file contents. If attacker can place a .pth file at a known path, achieves code execution during site initialization.. | |
| ## Impact: HIGH | |
| ## Reproduction | |
| ```bash | |
| pip install modelscan | |
| modelscan scan -p bypass_poc.pkl | |
| # Output: "No issues found!" | |
| ``` | |