drupal_http_request() fails to strip Cookie or Authorization headers on HTTP downgrade

Created on 30 June 2022, almost 2 years ago
Updated 2 November 2023, 8 months ago

Problem/Motivation

Drupal 7.x has a vulnerability similar to the two recently fixed in Guzzle:

https://github.com/guzzle/guzzle/security/advisories/GHSA-w248-ffj2-4v5q
https://github.com/guzzle/guzzle/security/advisories/GHSA-f2wf-25xc-69c9

drupal_http_request() automatically follows 3xx redirects. RFC 9110 states:

When automatically following a redirected request, the user agent SHOULD resend the original request message with the following modifications:

3. Consider removing header fields that were not automatically generated by the implementation (i.e., those present in the request because they were added by the calling context) where there are security implications; this includes but is not limited to Authorization and Cookie.

See https://www.rfc-editor.org/rfc/rfc9110.html#name-redirection-3xx

This issue has been discussed with the security team, and it has been decided that this can be handled as a security hardening issue in the public issue queue.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

7.0 ⚰️

Component
BaseΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
  • Security improvements

    It makes Drupal less vulnerable to abuse or misuse. Note, this is the preferred tag, though the Security tag has a large body of issues tagged to it. Do NOT publicly disclose security vulnerabilities; contact the security team instead. Anyone (whether security team or not) can apply this tag to security improvements that do not directly present a vulnerability e.g. hardening an API to add filtering to reduce a common mistake in contributed modules.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
Production build 0.69.0 2024