Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-31628

CVE-2022-31628: PHP Phar Uncompressor DOS Vulnerability

CVE-2022-31628 is a denial of service vulnerability in PHP's phar uncompressor that causes infinite loops when processing quine gzip files. This article covers the technical details, affected versions, and mitigation strategies.

Published: February 18, 2026

CVE-2022-31628 Overview

CVE-2022-31628 is a Denial of Service vulnerability affecting PHP's phar uncompressor functionality. In PHP versions before 7.4.31, 8.0.24, and 8.1.11, the phar uncompressor code would recursively uncompress "quines" gzip files, resulting in an infinite loop. This vulnerability allows a local attacker with low privileges to cause resource exhaustion and denial of service on affected systems by providing a specially crafted gzip archive.

Critical Impact

Local attackers can exploit this infinite loop vulnerability to cause complete denial of service on PHP applications that process untrusted phar archives, leading to CPU exhaustion and system unavailability.

Affected Products

  • PHP versions before 7.4.31
  • PHP versions 8.0.x before 8.0.24
  • PHP versions 8.1.x before 8.1.11
  • Fedora 35, 36, and 37
  • Debian Linux 10.0 and 11.0

Discovery Timeline

  • 2022-09-28 - CVE-2022-31628 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-31628

Vulnerability Analysis

This vulnerability resides in PHP's phar (PHP Archive) extension, specifically within the gzip decompression functionality. The root issue involves improper handling of self-referential or "quine" gzip files—archives that decompress into themselves or create recursive decompression cycles. When the phar uncompressor encounters such a file, it enters an uncontrolled recursive decompression loop, consuming CPU resources indefinitely until the process is terminated or the system becomes unresponsive.

The vulnerability is classified under CWE-674 (Uncontrolled Recursion) and CWE-835 (Infinite Loop), accurately describing the technical nature of the flaw. Exploitation requires local access and low privileges, meaning an attacker must be able to supply a malicious phar archive to a PHP application that processes such files.

Root Cause

The root cause stems from insufficient validation of gzip archive contents before and during the decompression process. The phar uncompressor failed to implement proper recursion depth limits or cycle detection when processing nested compressed content. When a gzip "quine" file—a file that decompresses to produce itself—is encountered, the decompression logic continuously attempts to decompress the same content without recognizing the recursive pattern, resulting in an infinite loop.

Attack Vector

The attack vector is local, requiring the attacker to provide a malicious gzip-compressed phar archive to a vulnerable PHP application. Attack scenarios include:

  1. Uploading a crafted phar archive through a file upload functionality
  2. Supplying malicious input to applications that process user-provided archives
  3. Exploiting any PHP script that uses phar stream wrappers on untrusted data

The vulnerability allows an attacker to craft a specially formatted gzip file that acts as a quine—when decompressed, it produces output that triggers another decompression cycle. This recursive behavior continues indefinitely, consuming CPU resources and effectively causing denial of service.

For technical details on the vulnerability mechanism, refer to the PHP Bug Report #81726.

Detection Methods for CVE-2022-31628

Indicators of Compromise

  • Abnormally high CPU utilization by PHP processes, particularly php-fpm or Apache worker processes
  • PHP processes running for extended periods without completing when processing archive files
  • System logs showing unresponsive PHP workers or process timeouts
  • Memory consumption growth in PHP processes handling phar archives

Detection Strategies

  • Monitor PHP process CPU usage for anomalies, especially sustained 100% utilization on single cores
  • Implement application-level logging for phar archive processing operations
  • Set up alerts for PHP process execution timeouts when handling file uploads or archive operations
  • Review web server logs for requests involving phar archive processing that result in timeouts

Monitoring Recommendations

  • Configure process monitoring to alert on PHP processes exceeding normal CPU thresholds for extended periods
  • Implement resource limits (max_execution_time, memory_limit) in PHP configuration to contain runaway processes
  • Enable detailed logging for file processing operations that involve phar or gzip functionality
  • Deploy SentinelOne Singularity platform to detect and respond to anomalous process behavior indicative of DoS attacks

How to Mitigate CVE-2022-31628

Immediate Actions Required

  • Upgrade PHP to version 7.4.31, 8.0.24, 8.1.11, or later immediately
  • Review and restrict file upload functionality that processes phar archives
  • Implement strict input validation for any application accepting archive files
  • Configure PHP resource limits to contain potential infinite loop scenarios

Patch Information

The PHP development team addressed this vulnerability in the following versions:

  • PHP 7.4.31 and later
  • PHP 8.0.24 and later
  • PHP 8.1.11 and later

Organizations should prioritize upgrading to patched versions. Additional vendor advisories are available:

  • Debian Security Advisory DSA-5277
  • Debian LTS Announcement
  • Gentoo GLSA 202211-03
  • NetApp Security Advisory

Workarounds

  • Disable phar processing if not required by setting phar.readonly = 1 in php.ini
  • Implement strict file type validation before processing any uploaded archives
  • Configure web application firewalls to inspect and filter suspicious archive uploads
  • Use process isolation and resource limits to contain potential DoS impact
bash
# PHP configuration hardening for phar handling
# Add to php.ini or php-fpm pool configuration

# Disable phar write operations (recommended if not needed)
phar.readonly = 1

# Set execution time limits to contain infinite loops
max_execution_time = 30

# Limit memory to prevent resource exhaustion
memory_limit = 128M

# Disable URL-based phar access
phar.require_hash = 1

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechPhp

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.04%

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

  • CWE-835
  • Technical References
  • PHP Bug Report #81726

  • Debian LTS Announcement December 2022

  • Fedora Package Announcement 1

  • Fedora Package Announcement 2

  • Fedora Package Announcement 3

  • Gentoo GLSA 202211-03

  • NetApp Security Advisory NTAP-20221209-0001

  • Debian Security Advisory DSA-5277
  • Related CVEs
  • CVE-2025-14180: PHP PDO PostgreSQL DoS Vulnerability

  • CVE-2025-6491: PHP SOAP Extension DoS Vulnerability

  • CVE-2025-1735: PHP pgsql/pdo_pgsql DOS Vulnerability

  • CVE-2024-2757: PHP mb_encode_mimeheader DoS Vulnerability
Default Legacy - Prefooter | 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