{"id":"CVE-2022-31091","aliases":["CVE-2022-31091","GHSA-q559-8m2m-g699"],"related":[],"kind":"vulnerability","state":"published","title":"Change in port should be considered a change in origin in Guzzle","summary":"Guzzle, an extensible PHP HTTP client. `Authorization` and `Cookie` headers on requests are sensitive information. In affected versions on making a request which responds with a redirect to a URI with a different port, if we choose to follow it, we should remove the `Authorization` and `Cookie` headers from the request, before containing. Previously, we would only consider a change in host or scheme. Affected Guzzle 7 users should upgrade to Guzzle 7.4.5 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.8 or 7.4.5. Note that a partial fix was implemented in Guzzle 7.4.2, where a change in host would trigger removal of the curl-added Authorization header, however this earlier fix did not cover change in scheme or change in port. 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Guzzle, an extensible PHP HTTP client. `Authorization` and `Cookie` headers on requests are sensitive information. In affected versions on making a request which responds with a redirect to a URI with a different port, if we choose to follow it, we should remove the `Authorization` and `Cookie` headers from the request, before containing. Previously, we would only consider a change in host or scheme. Affected Guzzle 7 users should upgrade to Guzzle 7.4.5 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.8 or 7.4.5. Note that a partial fix was implemented in Guzzle 7.4.2, where a change in host would trigger removal of the curl-added Authorization header, however this earlier fix did not cover change in scheme or change in port. 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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\n`Authorization` and `Cookie` headers on requests are sensitive information. On making a request which responds with a redirect to a URI with a different port, if we choose to follow it, we should remove the `Authorization` and `Cookie` headers from the request, before containing. Previously, we would only consider a change in host or scheme downgrade. Now, we consider any change in host, port or scheme to be a change in origin.\n\n### Patches\n\nAffected Guzzle 7 users should upgrade to Guzzle 7.4.5 as soon as possible. Affected users using any earlier series of Guzzle should upgrade to Guzzle 6.5.8 or 7.4.5.\n\n### Workarounds\n\nAn 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.\n\n### References\n\n* [RFC9110 Section 15.4](https://www.rfc-editor.org/rfc/rfc9110.html#name-redirection-3xx)\n* [CVE-2022-27776](https://curl.se/docs/CVE-2022-27776.html)\n\n### For more information\n\nIf you have any questions or comments about this advisory, please get in touch with us in `#guzzle` on the [PHP HTTP Slack](https://php-http.slack.com/). Do not report additional security advisories in that public channel, however please follow our [vulnerability reporting process](https://github.com/guzzle/guzzle/security/policy).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Guzzle, un cliente PHP HTTP extensible. Los encabezados \"Authorization\" y \"Cookie\" en las peticiones son información confidencial. En las versiones afectadas al realizar una petición que responde con un redireccionamiento a una URI con un puerto diferente, si decidimos seguirla, debemos eliminar los encabezados \"Authorization\" y \"Cookie\" de la petición, antes de contenerla. Anteriormente, sólo considerábamos un cambio de host o de esquema. Los usuarios de Guzzle 7 afectados deben actualizar a Guzzle versión 7.4.5 lo antes posible. Los usuarios afectados usando cualquier serie anterior de Guzzle deberían actualizar a Guzzle versiones 6.5.8 o 7.4.5. Tenga en cuenta que en Guzzle versión 7.4.2 fué implementado una corrección parcial, en la que un cambio de host desencadenaba una eliminación del encabezado de autorización añadida por curl, sin embargo esta corrección anterior no cubría el cambio de esquema o el cambio de puerto. Un enfoque alternativo sería usar su propio middleware de redireccionamiento, en lugar del nuestro, si no puede actualizar. Si usted no requiere o espera que sean seguidas los redireccionamientos, uno debería simplemente deshabilitar los redireccionamientos por completo","source":"nvd"}],"published":"2022-06-21T20:07:16.000Z","modified":"2026-06-17T04:44:46.673Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:S/C:P/I:N/A:N","score":4,"rating":"MEDIUM"}],"cwes":["CWE-200"],"affected":[{"ranges":[{"version":"< 6.5.8","status":"affected"},{"version":">=7.0.0, < 7.4.5","status":"affected"}],"vendor":"guzzle","product":"guzzle","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.5.8"}],"ecosystem":"Packagist","package":"guzzlehttp/guzzle","purl":"pkg:composer/guzzlehttp/guzzle","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.0.0","status":"affected","fixed":"7.4.5"}],"ecosystem":"Packagist","package":"guzzlehttp/guzzle","purl":"pkg:composer/guzzlehttp/guzzle","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"6.5.8"},{"status":"affected","introduced":"7.0.0","fixed":"7.4.5"}],"vendor":"guzzlephp","product":"guzzle","cpe":"cpe:2.3:a:guzzlephp:guzzle:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/guzzle/guzzle/commit/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82","tags":["patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/guzzle/guzzle/security/advisories/GHSA-q559-8m2m-g699","tags":["mitigation","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.debian.org/security/2022/dsa-5246","tags":["third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.gentoo.org/glsa/202305-24","tags":["vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31091","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/guzzlehttp/guzzle/CVE-2022-31091.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/guzzle/guzzle","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-23T14:04:47.252Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-31091","url":"https://www.cve.org/CVERecord?id=CVE-2022-31091","licence":"CVE Terms of Use","modified":"2025-04-23T18:08:21.161Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q559-8m2m-g699","url":"https://github.com/advisories/GHSA-q559-8m2m-g699","licence":"CC-BY-4.0","modified":"2023-11-08T04:09:25.594Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-31091","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31091","licence":"Public domain","modified":"2026-06-17T04:44:46.673Z"}],"updatedAt":"2026-11-25T22:58:12.598Z","epss":{"score":0.0159,"percentile":0.76368,"date":"2026-12-01T12:00:22.000Z"}}