Problem/Motivation

The rediect to the login page copies the request headers. I discovered this because the redirect caused a 502 error on Platform.sh. That was caused by an empty Content-Length sneaking in via the request and PSHs Nginx not liking it in the response.

Request headers shouldn't be uncritically copied to the response. Most request headers doesn't make sense in a response (Host: for instance) and others could cause an information leak of headers used between internal systems.

Steps to reproduce

With a working installation, one can run:

curl --head 'https://<host>/oauth/authorize?client_id=<client_id>&redirect_uri=<redirect_uri>&response_type=code' -H 'X-Some-Random: header'

and see the x-some-random header in the output (the case change is due to Symfonys handling of headers.

Proposed resolution

Remove the code adding the request headers.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Xen created an issue. See original summary.

  • bojan_dev committed d8e843d8 on 5.2.x authored by Xen
    Issue: #3455605 by Xen: Don't echo request headers
    
bojan_dev’s picture

Status: Active » Fixed

This was already resolved in 6.0.x, thanks for the MR.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.