LiveActive security incident?Get immediate response
CVE Record

CVE-2022-31091: Change in port should be considered a change in origin in Guzzle

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.

HighCVSS 7.7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2022-31091 is a sensitive-header leakage issue in the PHP Guzzle HTTP client. When affected versions followed a redirect to the same host but a different port, Authorization and Cookie headers could be forwarded when they should have been stripped. This can expose credentials or session data to an unintended endpoint.

Executive priority

Treat this as high priority for internet-connected or integration-heavy PHP services using Guzzle with credentials or cookies. The fix is straightforward, and the business risk is unintended disclosure of tokens or session data.

Technical view

Guzzle redirect handling did not treat a port change as an origin change, so sensitive request headers could survive redirects across ports. Affected versions are Guzzle before 6.5.8 and 7.0.0 through before 7.4.5. The issue is CWE-200 with CVSS 3.1 score 7.7, driven by confidentiality impact.

Likely exposure

Exposure is most likely in PHP applications or dependencies using affected Guzzle versions, following redirects, and sending Authorization or Cookie headers. Systems using distribution packages may also be affected unless they received fixed Debian or Gentoo updates.

Exploitation context

The source bundle does not indicate CISA KEV listing or active exploitation. Practical risk depends on whether an application follows redirects while carrying sensitive headers, and whether redirected targets can reach a different port that receives those headers.

Researcher notes

The key behavior is redirect origin comparison: host and scheme checks were insufficient because port changes also alter origin. The advisory notes a partial 7.4.2 fix that did not fully cover scheme and port handling.

Mitigation direction

  • Upgrade Guzzle 7 users to 7.4.5 or later.
  • Upgrade earlier Guzzle series to 6.5.8 or 7.4.5.
  • Disable redirects where redirects are not required or expected.
  • Use custom redirect middleware if upgrading is temporarily impossible.
  • Apply relevant Debian or Gentoo security updates where packaged versions are used.

Validation and detection

  • Check composer.lock and dependency manifests for affected Guzzle versions.
  • Review Guzzle client configuration for enabled redirect following.
  • Identify requests that send Authorization or Cookie headers through Guzzle.
  • Verify deployed packages include fixed upstream or distro-patched builds.
  • Confirm vendor guidance before accepting compensating controls.
Prepared
Confidence
high
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-200: Information exposure and cloud metadata lookup

Information exposure and SSRF weaknesses can make discovery, cloud metadata, and credential material review relevant. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2022-31091 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.7 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.7CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N3.14Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.7High
CVSS 3.1 vector shape for CVE-2022-31091Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
guzzleguzzle< 6.5.8, >=7.0.0, < 7.4.5Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-200 · source CWE mapping

Exposure of Sensitive Information to an Unauthorized Actor

Exposure of Sensitive Information to an Unauthorized Actor represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.