SecurityMiddleware missing from MIDDLEWARE
Part of Security, which counts for 30% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
A MIDDLEWARE list is defined with no django.middleware.security.SecurityMiddleware entry, so Django never applies SECURE_HSTS_SECONDS, SECURE_SSL_REDIRECT, SECURE_CONTENT_TYPE_NOSNIFF, or the referrer-policy header, even if those settings are configured.
Why it matters
With no SecurityMiddleware in MIDDLEWARE, Django never applies SECURE_HSTS_SECONDS, SECURE_SSL_REDIRECT, SECURE_CONTENT_TYPE_NOSNIFF, or SECURE_REFERRER_POLICY, even if every one of those settings is configured correctly. The settings sit there doing nothing, which is a config trap: a security review of settings.py alone would look fine while the actual response headers ship none of it.
How to fix it
Add 'django.middleware.security.SecurityMiddleware' back into MIDDLEWARE, in the position Django's default scaffold puts it (first, or immediately after any CDN/proxy-specific middleware). Then confirm the SECURE_* settings you rely on are actually configured, since the middleware only enforces settings that exist.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo