Skip to content

Login to OLS web admin console using port forwarding#481

Open
praximatec wants to merge 1 commit into
litespeedtech:masterfrom
praximatec:fix-port-forwarded-access
Open

Login to OLS web admin console using port forwarding#481
praximatec wants to merge 1 commit into
litespeedtech:masterfrom
praximatec:fix-port-forwarded-access

Conversation

@praximatec
Copy link
Copy Markdown

Hardcoded comparison between HTTP_REFERER port and SERVER_PORT breaks admin access when using TCP tunneling solutions like Google Cloud IAP, SSH tunneling, or Docker port mapping where the local port differs from the container/instance port.

The Host header (HTTP_HOST) represents the authority as seen by the client. For CSRF protection, the Referer should match the host the browser is interacting with, not the physical port the server process is bound to.

This change doesn't weaken CSRF protection because it still ensures the Referer matches the actual host/port used to access the application.

https://forum.openlitespeed.org/threads/ols-web-admin-console-login-issue-using-alternative-web-admin-port.14503/

Note on Reverse Proxies:

If the web admin console is deployed behind a reverse proxy (e.g., Nginx, HAProxy, Cloudflare), the proxy must be configured to pass the original Host header to the backend. If the proxy rewrites the Host header to an internal address or port, the CSRF validation will correctly fail because the external Referer will not match the rewritten internal Host.

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.

1 participant