Skip to content

Conversation

@Kiryuumaru
Copy link

Fixes #5207 - Security issue where Force SSL leaks host existence

When both Force SSL and an Access List are active on a Proxy Host, HTTP requests from unauthorized IPs were receiving a 301 redirect instead of being blocked. This allowed attackers to enumerate valid hosts by brute-forcing the Host header.

Solution: Use nginx geo module to check IP access before the SSL redirect. Only allowed IPs get redirected to HTTPS; denied IPs fall through to the access phase and receive 403.

Changes:

  • Add geo block template for IP-based access control
  • Modify _forced_ssl.conf to check geo variable before redirecting
  • Generate geo config files when access lists are created/updated
  • Include geo configs at http level in nginx.conf
  • Create access_geo directory on startup

@Kiryuumaru Kiryuumaru force-pushed the fix/force-ssl-access-list-bypass branch 2 times, most recently from 050ee89 to 58b4057 Compare January 22, 2026 04:28
Fixes NginxProxyManager#5207 - Security issue where Force SSL leaks host existence

When both Force SSL and an Access List are active on a Proxy Host,
HTTP requests from unauthorized IPs were receiving a 301 redirect
instead of being blocked. This allowed attackers to enumerate valid
hosts by brute-forcing the Host header.

Solution: Use nginx geo module to check IP access before the SSL
redirect. Only allowed IPs get redirected to HTTPS; denied IPs
fall through to the access phase and receive 403.

Changes:
- Add geo block template for IP-based access control
- Modify _forced_ssl.conf to check geo variable before redirecting
- Generate geo config files when access lists are created/updated
- Include geo configs at http level in nginx.conf
- Create access_geo directory on startup
@Kiryuumaru Kiryuumaru force-pushed the fix/force-ssl-access-list-bypass branch from 58b4057 to 19086ce Compare January 22, 2026 04:46
@Kiryuumaru Kiryuumaru marked this pull request as ready for review January 22, 2026 04:59
@nginxproxymanagerci
Copy link

Docker Image for build 2 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-5208

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

@Kiryuumaru
Copy link
Author

PR is tested and ready for review 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Force SSL redirect is applied before Access List, leaking host existence via 301 and aiding host enumeration

1 participant