Skip to content

Fix weakness to host header manipulation - #1121

Open
markstory wants to merge 1 commit into
5.xfrom
fix-host-trust
Open

markstory wants to merge 1 commit into
5.xfrom
fix-host-trust

Conversation

@markstory

Copy link
Copy Markdown
Member

For a long time we used HTTP_HOST as a fallback for fullBaseUrl, but doing so makes applications vulnerable to host header injection. In #1071, the HostHeaderMiddleware was introduced to address this weakness. However, in #1076 the debug condition was removed to address feedback, but also re-opened the weakness to host-header injection.

These changes restore the debug check around automatically trusting HTTP_HOST. The HostHeaderMiddleware is applied after error handling so configuration mistakes are easy to identify.

Thanks to Jaro Varga for reporting this.

For a long time we used `HTTP_HOST` as a fallback for `fullBaseUrl`, but
doing so makes applications vulnerable to host header injection. In #1071,
the `HostHeaderMiddleware` was introduced to address this weakness.
However, in #1076 the debug condition was removed to address feedback,
but also re-opened the weakness to host-header injection.

These changes restore the `debug` check around automatically trusting
`HTTP_HOST`. The `HostHeaderMiddleware` is applied *after* error
handling so configuration mistakes are easy to identify.

Thanks to Jaro Varga for reporting this.
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