flask-header-guard (PyPI) · Malicious Code
Affects flask-header-guardSource GCVE Database
Malicious package : remove flask-header-guard and rotate any secrets on hosts that installed it.
Data as of 9 Sep 2026, 21:52 UTC
Malicious package
Published to PyPI · OSV MAL-2026-15566
What to do
Remove flask-header-guard from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIflask-header-guard | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The flask-header-guard package on PyPI (version 1.0.0) is a malicious package masquerading as Flask security-headers middleware. It executes hostile code during installation and when imported, including exfiltration of sensitive environment variables and system files, establishing persistence via a reverse shell, local privilege escalation, and an unauthenticated remote code execution backdoor in Flask apps.