The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-31042

CVE-2022-31042: Guzzle Cookie Header Disclosure Flaw

CVE-2022-31042 is an information disclosure vulnerability in Guzzlephp Guzzle that exposes Cookie headers during redirects. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 11, 2026

CVE-2022-31042 Overview

CVE-2022-31042 is an Information Disclosure vulnerability in Guzzle, an open source PHP HTTP client. The vulnerability exists in how Guzzle handles Cookie headers during HTTP redirects. When a request using the https scheme receives a redirect response to a URI with the http scheme, or when redirected to a different host, the Cookie header should be stripped to prevent sensitive information leakage. Prior to the fix, only cookies managed by Guzzle's cookie middleware were safely removed, while any Cookie header manually added to the initial request remained attached during the redirect, potentially exposing sensitive session data to unintended recipients.

Critical Impact

Sensitive cookie data including session tokens and authentication credentials may be inadvertently exposed to malicious servers during cross-origin or protocol-downgrade redirects.

Affected Products

  • Guzzle PHP HTTP Client (versions prior to 6.5.7 and 7.4.4)
  • Drupal Core (versions 9.2.x, 9.3.x, and 9.4.x pre-release)
  • Debian Linux 11.0

Discovery Timeline

  • 2022-06-10 - CVE-2022-31042 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-31042

Vulnerability Analysis

This vulnerability represents an improper handling of sensitive information during HTTP redirect operations. The Guzzle HTTP client library includes built-in redirect middleware that automatically follows HTTP redirects (3xx status codes). According to RFC 9110 Section on Redirection, clients should exercise caution when forwarding credentials across different origins or when downgrading from secure to insecure protocols.

The flaw stems from an inconsistency in how different types of cookies were handled during redirects. While cookies managed through Guzzle's cookie middleware were properly evaluated and stripped when appropriate, manually-added Cookie headers bypassed this security check entirely. This created a scenario where developers who added cookies directly to request headers—a common practice for custom authentication flows—unknowingly exposed those cookies to any server in the redirect chain.

Root Cause

The root cause is a failure to uniformly sanitize all Cookie headers during redirect processing in the RedirectMiddleware component. The middleware implementation only considered cookies managed by the internal cookie jar, overlooking the possibility of manually-appended Cookie headers on the initial request. This oversight violates the principle of least privilege for credential transmission across domain boundaries.

Attack Vector

An attacker can exploit this vulnerability through a man-in-the-middle position or by controlling a server that legitimately receives requests from a Guzzle-based application. The attack scenario involves:

  1. The victim application makes an HTTPS request with sensitive cookies to an attacker-controlled or compromised server
  2. The malicious server responds with a redirect to an HTTP endpoint or a different host under attacker control
  3. Guzzle automatically follows the redirect, inadvertently forwarding the manually-added Cookie header
  4. The attacker captures the sensitive cookie data, which may include session tokens or API credentials

The fix ensures that all Cookie headers are stripped unconditionally during redirects, with the cookie middleware re-evaluating and re-adding only those cookies appropriate for the new destination.

php
     }
 
     /**
-     * Check for too many redirects
+     * Check for too many redirects.
      *
      * @throws TooManyRedirectsException Too many redirects.
      */

Source: GitHub Commit e3ff079b22820c2029d4c2a87796b6a0b8716ad8

Detection Methods for CVE-2022-31042

Indicators of Compromise

  • Unexpected HTTP traffic to external or untrusted domains following initial API requests
  • Log entries showing redirect chains that cross domain boundaries or downgrade from HTTPS to HTTP
  • Session hijacking or unauthorized account access following application interactions with external services
  • Cookie values appearing in access logs of unintended third-party servers

Detection Strategies

  • Review application dependencies and verify Guzzle versions using composer show guzzlehttp/guzzle
  • Audit application code for manual Cookie header additions to Guzzle requests
  • Monitor network traffic for redirect responses that cross domain boundaries or protocol downgrades
  • Implement logging for all outbound HTTP requests to detect unexpected cookie transmission patterns

Monitoring Recommendations

  • Enable verbose logging for HTTP client operations in development and staging environments
  • Configure web application firewalls to alert on sensitive cookie transmission to non-whitelisted domains
  • Implement runtime application self-protection (RASP) solutions to monitor cookie handling behavior
  • Regularly scan dependencies for known vulnerabilities using tools like Composer Audit or Snyk

How to Mitigate CVE-2022-31042

Immediate Actions Required

  • Upgrade Guzzle to version 7.4.4 or later for Guzzle 7.x users
  • Upgrade Guzzle to version 6.5.7 or later for users on the 6.x series
  • Review and update Drupal Core installations to patched versions as per the Drupal Core Security Advisory SA-CORE-2022-011
  • Audit all Guzzle client configurations for manual Cookie header usage

Patch Information

The vulnerability has been addressed in Guzzle versions 6.5.7 and 7.4.4. The fix modifies the RedirectMiddleware to unconditionally strip all Cookie headers before following redirects, then allows the cookie middleware to re-add appropriate cookies for the new destination. The patch is available in the GitHub commit e3ff079b22820c2029d4c2a87796b6a0b8716ad8. Debian users should apply updates from DSA-5246. Additional technical details are available in the GitHub Security Advisory GHSA-f2wf-25xc-69c9.

Workarounds

  • Disable automatic redirect following by setting allow_redirects to false in Guzzle client configuration
  • Implement custom redirect middleware that properly sanitizes sensitive headers before following redirects
  • Use Guzzle's cookie jar middleware exclusively instead of manually adding Cookie headers
  • Configure application firewalls to block outbound requests that would result in protocol downgrades
bash
# Upgrade Guzzle via Composer
composer require guzzlehttp/guzzle:^7.4.4

# Or for Guzzle 6.x users
composer require guzzlehttp/guzzle:^6.5.7

# Verify installed version
composer show guzzlehttp/guzzle | grep versions

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechGuzzle

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.69%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-200

  • CWE-212
  • Technical References
  • GitHub Security Advisory

  • Debian Security Advisory DSA-5246

  • RFC 9110 Redirection Section
  • Vendor Resources
  • GitHub Commit Update

  • Drupal Core Security Advisory
  • Related CVEs
  • CVE-2022-31090: Guzzlephp Guzzle Info Disclosure Flaw

  • CVE-2022-31043: Guzzlephp Guzzle Information Disclosure
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English