Skip to content

HTTPS behind a reverse proxy isn't detected (X-Forwarded-Proto ignored) #444

Open

Description

@caseysoftware

base.php L56 decides between http:// and https:// from $_SERVER['HTTPS'] only. Behind a proxy or load balancer that terminates TLS and talks plain HTTP to PHP, W2P_BASE_URL starts with http://, and since c8b01906 the session cookie is not marked Secure.

Fix: a trusted_proxies setting; when the request comes from one of them, honour X-Forwarded-Proto (and X-Forwarded-Host/-Port). Never trust the headers from other clients. The same setting is used by the trusted-header sign-in in Phase 4.

Blocks #458.

Fix before Phase 0 of the Identity Layer proposal (#435).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions