Forbid setting the Location and Refresh custom response headers#98129
Forbid setting the Location and Refresh custom response headers#98129legrego merged 3 commits intoelastic:masterfrom
Conversation
|
I tried several ways to circumvent this restriction:
All of these attempts were unsuccessful because Node is pretty strict with HTTP header key/value validation (https://github.com/nodejs/node/blob/ee9e2a2eb6143fa7b4b1454f7aed009a8703d4d7/lib/_http_common.js#L214-L233 via https://github.com/nodejs/node/blob/ee9e2a2eb6143fa7b4b1454f7aed009a8703d4d7/lib/_http_outgoing.js#L556-L570). However, I did find one alternative way to control where the browser goes: So I think this denylist approach will work, but perhaps we should take a step back and evaluate all HTTP response headers. At a minimum it sounds like we will need to have |
Thanks for testing this Joe, much appreciated! I agree we should add |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
…tic#98129) # Conflicts: # src/core/server/http/http_config.ts
|
Manual backport to |
…) (#98205) Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
…) (#98206) # Conflicts: # src/core/server/http/http_config.ts
…) (#98204) Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
|
Pinging @elastic/kibana-security (Team:Security) |
Summary
The
server.customResponseHeadersallows administrators to configure a custom set of headers that the Kibana server will send with every response. We have historically not had much validation around this because we can't know all the valid use cases for this feature in advance.Two headers that I don't see a valid need for is
LocationandRefresh-- setting these response headers would force the browser to redirect every response to a fixed value, which does not make a whole lot of sense.This PR adds a deny list of headers, with
LocationandRefreshspecified