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-21647

CVE-2022-21647: CodeIgniter RCE Vulnerability

CVE-2022-21647 is a deserialization RCE vulnerability in CodeIgniter4 that allows remote attackers to inject auto-loadable objects and execute PHP code. This post explains its impact, affected versions, and mitigation.

Published: February 18, 2026

CVE-2022-21647 Overview

CVE-2022-21647 is an insecure deserialization vulnerability discovered in CodeIgniter4, an open source PHP full-stack web framework. The vulnerability exists in the old() function, which unsafely deserializes user-controlled data. Remote attackers can exploit this flaw to inject auto-loadable arbitrary objects, potentially leading to arbitrary PHP code execution on the server. A working exploit has been confirmed that can lead to SQL injection attacks.

Critical Impact

Remote attackers can exploit insecure deserialization in CodeIgniter4's old() function to execute arbitrary PHP code and perform SQL injection attacks without authentication.

Affected Products

  • CodeIgniter4 versions prior to v4.1.6
  • Applications using the old() function and form_helper
  • Applications using RedirectResponse::withInput() and redirect()->withInput()

Discovery Timeline

  • 2022-01-04 - CVE-2022-21647 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-21647

Vulnerability Analysis

The vulnerability stems from unsafe deserialization within CodeIgniter4's old() function. This function is commonly used in forms to repopulate input fields with previously submitted data after validation failures. The core issue is that the function directly calls PHP's unserialize() on user-controlled input without proper validation.

When the old() function retrieves previously submitted form data, it checks if the stored value is a serialized array or string by examining the prefix (a: for arrays or s: for strings). If the condition matches, it blindly deserializes the data. This allows attackers to craft malicious serialized payloads that, when deserialized, can instantiate arbitrary PHP objects with attacker-controlled properties.

The vulnerability is classified as CWE-502 (Deserialization of Untrusted Data). Successful exploitation can lead to remote code execution through PHP object injection, and a confirmed exploit path demonstrates the ability to perform SQL injection attacks on vulnerable systems.

Root Cause

The root cause is the direct use of PHP's unserialize() function on untrusted user input within the old() helper function. The vulnerable code path checked if the value started with a: (serialized array) or s: (serialized string) and proceeded to deserialize it without any integrity verification or input sanitization. This design allows attackers to inject malicious serialized objects that trigger dangerous operations when instantiated through PHP's magic methods like __wakeup(), __destruct(), or __toString().

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Submitting malicious serialized PHP objects through form inputs that will be stored and later processed by the old() function
  2. Crafting payloads that exploit available gadget chains within the application or its dependencies
  3. When the old() function processes the malicious input, the unserialize() call instantiates the attacker's objects, triggering code execution

The vulnerable code that was removed in the patch:

php
// Vulnerable code removed in the security patch
// If the result was serialized array or string, then unserialize it for use...
if (is_string($value) && (strpos($value, 'a:') === 0 || strpos($value, 's:') === 0)) {
    $value = unserialize($value);
}

Source: GitHub Commit Record

The patch in system/Common.php removes the unsafe deserialization logic entirely:

php
            return $default;
        }

-        // If the result was serialized array or string, then unserialize it for use...
-        if (is_string($value) && (strpos($value, 'a:') === 0 || strpos($value, 's:') === 0)) {
-            $value = unserialize($value);
-        }
-
        return $escape === false ? $value : esc($value, $escape);
    }
}

Source: GitHub Commit Record

Detection Methods for CVE-2022-21647

Indicators of Compromise

  • Unusual serialized PHP objects appearing in form submissions or session data (patterns starting with O: for objects, a: for arrays)
  • Unexpected database queries or SQL errors following form submissions
  • Error logs showing PHP object instantiation failures or unexpected class loading
  • Web application firewall alerts for serialized data patterns in HTTP requests

Detection Strategies

  • Monitor HTTP request bodies for serialized PHP data patterns (e.g., O:[0-9]+:, a:[0-9]+:, s:[0-9]+:)
  • Implement application logging to track calls to the old() function and analyze input patterns
  • Deploy SentinelOne's Application Control to detect unusual PHP process behaviors and unexpected code execution
  • Use static code analysis tools to identify usage of vulnerable CodeIgniter4 versions and the affected functions

Monitoring Recommendations

  • Enable detailed web server access logs and monitor for anomalous POST requests containing serialized data
  • Configure SIEM rules to alert on PHP deserialization attack signatures
  • Monitor application performance metrics for unusual CPU or memory spikes that may indicate successful exploitation
  • Review database query logs for unauthorized or malformed queries originating from web application processes

How to Mitigate CVE-2022-21647

Immediate Actions Required

  • Upgrade CodeIgniter4 to version 4.1.6 or later immediately
  • If immediate upgrade is not possible, avoid using the old() function, form_helper, RedirectResponse::withInput(), and redirect()->withInput() methods
  • Review application code for any custom deserialization logic and ensure proper input validation
  • Audit access logs for evidence of exploitation attempts

Patch Information

The CodeIgniter team has addressed this vulnerability in version 4.1.6. The fix removes the unsafe unserialize() call entirely from the old() function in system/Common.php. Users should upgrade to this version or later as the recommended remediation.

For detailed patch information, refer to the GitHub Commit Record and the GitHub Security Advisory.

Workarounds

  • Disable or remove usage of the old() function from all form templates until patching is complete
  • Do not use redirect()->withInput() or RedirectResponse::withInput() methods
  • Implement a Web Application Firewall (WAF) rule to block requests containing serialized PHP data patterns
  • Consider implementing a custom wrapper around form handling that validates input types before processing
bash
# Upgrade CodeIgniter4 using Composer
composer require codeigniter4/framework:^4.1.6

# Verify the installed version
composer show codeigniter4/framework | grep versions

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechCodeigniter

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability10.87%

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

  • GitHub Security Advisory GHSA
  • Related CVEs
  • CVE-2025-54418: CodeIgniter ImageMagick RCE Vulnerability

  • CVE-2022-24711: CodeIgniter4 RCE Vulnerability

  • CVE-2026-34572: CI4MS Authentication Bypass Vulnerability

  • CVE-2026-34560: CI4MS CodeIgniter CMS XSS Vulnerability
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