Modelscan Bypass PoC: imaplib.IMAP4 SSRF
Security Research — Responsible Disclosure
This model file demonstrates a modelscan bypass using imaplib.IMAP4.
The IMAP4 constructor connects to the specified host immediately on construction,
enabling Server-Side Request Forgery (SSRF) attacks.
Vulnerability
- Module:
imaplib.IMAP4(Python stdlib) - Type: SSRF (CWE-918)
- Impact: Network access to attacker-controlled server on model load
- Modelscan result: "No issues found" on both .pkl and pytorch_model.bin
How it works
imaplib.IMAP4(host) connects to the host immediately when the constructor is called.
This module is NOT in modelscan's unsafe_globals blocklist, so the pickle passes scanning
but executes a network connection when loaded with pickle.load() or torch.load().
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support