CVE-2022-31043
JSON

7.5high

Fix failure to strip Authorization header on HTTP downgrade in Guzzle

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
1.99% (higher than 81% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-f2wf-25xc-69c9BIT-DRUPAL-2022-31042BIT-DRUPAL-2022-31043DRUPAL-CORE-2022-011GHSA-w248-ffj2-4v5q

Description

Guzzle is an open source PHP HTTP client. In affected versions `Authorization` headers on requests are sensitive information. On making a request using the `https` scheme to a server which responds with a redirect to a URI with the `http` scheme, we should not forward the `Authorization` header on. This is much the same as to how we don't forward on the header if the host changes. Prior to this fix, `https` to `http` downgrades did not result in the `Authorization` header being removed, only changes to the host. Affected Guzzle 7 users should upgrade to Guzzle 7.4.4 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.7 or 7.4.4. Users unable to upgrade may consider an alternative approach which would be to use their own redirect middleware. Alternately users may simply disable redirects all together if redirects are not expected or required.

Affected

Product or packageVersionsReported by
guzzle guzzle< 6.5.7, >=7.0.0, < 7.4.4CVE List
guzzlehttp/guzzle (Packagist)from 4.0.0 before 6.5.7, from 7.0.0 before 7.4.4GitHub Advisory Database
drupal/core (Packagist)from 8.0.0 before 9.2.21, from 9.3.0 before 9.3.16Drupal Security Team
guzzlephp guzzlebefore 6.5.7, from 7.0.0 before 7.4.4NVD
drupal drupalfrom 9.2.0 before 9.2.21, from 9.3.0 before 9.3.16, 9.4.0NVD
debian debian_linux11.0NVD
drupal (Bitnami)from 9.2.0 before 9.2.21, from 9.3.0 before 9.3.16Bitnami Vulnerability Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:P/I:N/A:N
Bitnami Vulnerability Databasehigh rating

Classification

CWE-200CWE-212CWE-863

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Guzzle is an open source PHP HTTP client. In affected versions `Authorization` headers on requests are sensitive information. On making a request using the `https` scheme to a server which responds with a redirect to a URI with the `http` scheme, we should not forward the `Authorization` header on. This is much the same as to how we don't forward on the header if the host changes. Prior to this fix, `https` to `http` downgrades did not result in the `Authorization` header being removed, only changes to the host. Affected Guzzle 7 users should upgrade to Guzzle 7.4.4 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.7 or 7.4.4. Users unable to upgrade may consider an alternative approach which would be to use their own redirect middleware. Alternately users may simply disable redirects all together if redirects are not expected or required.

GitHub Advisory Database
Impact

Cookie headers on requests are sensitive information. On making a request using the https scheme to a server which responds with a redirect to a URI with the http scheme, or on making a request to a server which responds with a redirect to a a URI to a different host, we should not forward the Cookie header on. Prior to this fix, only cookies that were managed by our cookie middleware would be safely removed, and any Cookie header manually added to the initial request would not be stripped. We now always strip it, and allow the cookie middleware to re-add any cookies that it deems should be there.

Patches

Affected Guzzle 7 users should upgrade to Guzzle 7.4.4 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.7 or 7.4.4.

Workarounds

An alternative approach would be to use your own redirect middleware, rather than ours, if you are unable to upgrade. If you do not require or expect redirects to be followed, one should simply disable redirects all together.

References
For more information

If you have any questions or comments about this advisory, please get in touch with us in #guzzle on the PHP HTTP Slack. Do not report additional security advisories in that public channel, however - please follow our vulnerability reporting process.

GitHub Advisory Database
Impact

Authorization headers on requests are sensitive information. On making a request using the https scheme to a server which responds with a redirect to a URI with the http scheme, we should not forward the Authorization header on. This is much the same as to how we don't forward on the header if the host changes. Prior to this fix, https to http downgrades did not result in the Authorization header being removed, only changes to the host.

Patches

Affected Guzzle 7 users should upgrade to Guzzle 7.4.4 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.7 or 7.4.4.

Workarounds

An alternative approach would be to use your own redirect middleware, rather than ours, if you are unable to upgrade. If you do not require or expect redirects to be followed, one should simply disable redirects all together.

References
For more information

If you have any questions or comments about this advisory, please get in touch with us in #guzzle on the PHP HTTP Slack. Do not report additional security advisories in that public channel, however - please follow our vulnerability reporting process.

Drupal Security Team

Updated 22:00 UTC 2022-06-10: Added steps to update without drupal/core-recommended.

Drupal uses the third-party Guzzle library for handling HTTP requests and responses to external services. Guzzle has released two security advisories:

These do not affect Drupal core, but may affect some contributed projects or custom code on Drupal sites.

We are issuing this security advisory outside our regular Drupal security release window schedule since Guzzle has already published information about the vulnerabilities, and vulnerabilities might exist in contributed modules or custom modules that use Guzzle for outgoing requests. Guzzle has rated these vulnerabilities as high-risk.

This advisory is not covered by Drupal Steward.

NVD (es)

Guzzle es un cliente PHP HTTP de código abierto. En las versiones afectadas los encabezados "Authorization" de las peticiones son información confidencial. Al hacer una petición usando el esquema "https" a un servidor que responde con un redireccionamiento a una URI con el esquema "http", no deberíamos reenviar el encabezado "Authorization". Esto es muy parecido a no reenviar el encabezado si el host cambia. Anterior a esta corrección, las actualizaciones de "https" a "http" no provocaban la eliminación del encabezado "Authorization", sólo los cambios en el host. Los usuarios de Guzzle 7 afectados deben actualizar a Guzzle versión 7.4.4 lo antes posible. Los usuarios afectados usando cualquier serie anterior de Guzzle deberían actualizar a Guzzle versión 6.5.7 o 7.4.4. Los usuarios que no puedan actualizar pueden considerar un enfoque alternativo que sería usar su propio middleware de redireccionamiento. Alternativamente, los usuarios pueden simplemente deshabilitar los redireccionamientos si éstas no son esperadas o requeridas

Bitnami Vulnerability Database

Guzzle is an open source PHP HTTP client. In affected versions the Cookie headers on requests are sensitive information. On making a request using the https scheme to a server which responds with a redirect to a URI with the http scheme, or on making a request to a server which responds with a redirect to a a URI to a different host, we should not forward the Cookie header on. Prior to this fix, only cookies that were managed by our cookie middleware would be safely removed, and any Cookie header manually added to the initial request would not be stripped. We now always strip it, and allow the cookie middleware to re-add any cookies that it deems should be there. Affected Guzzle 7 users should upgrade to Guzzle 7.4.4 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.7 or 7.4.4. Users unable to upgrade may consider an alternative approach to use your own redirect middleware, rather than ours. If you do not require or expect redirects to be followed, one should simply disable redirects all together.

References

https://github.com/guzzle/guzzle/commit/e3ff079b22820c2029d4c2a87796b6a0b8716ad8advisory, patch, third-party-advisory, web
https://www.rfc-editor.org/rfc/rfc9110.html#name-redirection-3xxadvisory, third-party-advisory, web
https://github.com/guzzle/guzzle/security/advisories/GHSA-w248-ffj2-4v5qadvisory, third-party-advisory, web
https://www.drupal.org/sa-core-2022-011advisory, patch, third-party-advisory, web
https://www.debian.org/security/2022/dsa-5246advisory, third-party-advisory, vendor-advisory, web
https://github.com/guzzle/guzzle/security/advisories/GHSA-f2wf-25xc-69c9advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2022-31042advisory, web
https://github.com/FriendsOfPHP/security-advisories/blob/master/guzzlehttp/guzzle/CVE-2022-31042.yamlweb
https://github.com/guzzle/guzzlepackage
https://nvd.nist.gov/vuln/detail/CVE-2022-31043advisory, web
https://github.com/FriendsOfPHP/security-advisories/blob/master/guzzlehttp/guzzle/CVE-2022-31043.yamlweb

Related

Sources

SourceRecordLicence
CVE ListCVE-2022-31043 changed 2025-04-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-f2wf-25xc-69c9 changed 2025-12-10CC-BY-4.0
GitHub Advisory DatabaseGHSA-w248-ffj2-4v5q changed 2025-12-10CC-BY-4.0
Drupal Security TeamDRUPAL-CORE-2022-011 changed 2026-09-19MIT
NVDCVE-2022-31043 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-DRUPAL-2022-31042 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-DRUPAL-2022-31043 changed 2026-09-08Apache-2.0