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

CVE-2022-21647: CodeIgniter RCE Vulnerability

CVE-2022-21647 is a remote code execution flaw in CodeIgniter4 caused by unsafe deserialization in the old() function. Attackers can inject arbitrary objects and execute PHP code. This article covers technical details, affected versions, impact, and mitigation strategies.

Updated: May 16, 2026

CVE-2022-21647 Overview

CVE-2022-21647 is an insecure deserialization vulnerability [CWE-502] in CodeIgniter4, an open source PHP full-stack web framework. The flaw resides in the old() function, which deserializes untrusted data submitted through form input. Remote attackers can inject auto-loadable arbitrary PHP objects, triggering object instantiation and possible execution of existing PHP code on the server. A working exploit chain leading to SQL injection has been confirmed by the maintainers. The vulnerability affects CodeIgniter4 versions prior to 4.1.6 and is exploitable over the network without authentication or user interaction.

Critical Impact

Unauthenticated remote attackers can deserialize arbitrary objects through the old() function, leading to PHP object injection and confirmed SQL injection exploitation paths.

Affected Products

  • CodeIgniter4 versions prior to 4.1.6
  • Applications using the old() function and form_helper
  • Applications using RedirectResponse::withInput() or 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 of user-controlled input inside CodeIgniter4's old() helper. The function is intended to repopulate form fields with previously submitted values stored in the session flashdata. CodeIgniter4 stored these values using PHP serialization, and the old() function deserialized them on retrieval without validating the type or origin of the serialized payload.

Because an attacker can influence the data persisted into flashdata through form submissions, they can stage a serialized payload containing crafted PHP objects. When the application later renders a view that calls old(), form_helper functions, or returns via RedirectResponse::withInput(), the framework invokes unserialize() on the attacker-controlled blob. This triggers PHP object instantiation and magic methods such as __wakeup, __destruct, and __toString, enabling a property-oriented programming (POP) chain across auto-loadable classes shipped with the application or its dependencies.

Root Cause

The root cause is the use of PHP unserialize() on untrusted, attacker-influenced input within the input redisplay path. The framework treated flashdata as trusted state, yet its contents originated from user-submitted form fields.

Attack Vector

An attacker submits a crafted form payload that the application persists into session flashdata via the input redisplay mechanism. On the subsequent request, the application calls old() or related helpers, deserializing the payload. Given a suitable POP gadget chain in the loaded classes, the attacker achieves SQL injection or arbitrary code execution within the PHP runtime context. Refer to the GitHub Security Advisory GHSA-w6jr-wj64-mc9x for additional details.

// No verified public exploit code is available.
// See the upstream advisory and patch commit for technical specifics.

Detection Methods for CVE-2022-21647

Indicators of Compromise

  • Form submissions containing serialized PHP payloads beginning with O:, a:, or s: markers in fields not expected to contain serialized data.
  • Session flashdata entries containing unexpected object signatures referencing application classes or third-party library classes.
  • Web server access logs showing POST requests with abnormally large or base64-like form values targeting routes that issue redirects with input.
  • Unexpected SQL queries originating from request handlers that invoke old() or form_helper functions.

Detection Strategies

  • Inspect HTTP request bodies for serialized PHP object signatures using a web application firewall or reverse proxy filter.
  • Audit application code for use of old(), form_helper, RedirectResponse::withInput(), and redirect()->withInput() on CodeIgniter4 builds older than 4.1.6.
  • Correlate PHP error logs for unexpected class autoloads or magic method invocations following form submissions.

Monitoring Recommendations

  • Enable verbose logging of session flashdata writes and reads in non-production environments to baseline expected content.
  • Monitor outbound database queries for anomalous statements emitted shortly after redirect-with-input flows.
  • Track installed CodeIgniter4 versions across application inventories and alert on any instance below 4.1.6.

How to Mitigate CVE-2022-21647

Immediate Actions Required

  • Upgrade CodeIgniter4 to version 4.1.6 or later across all environments.
  • Audit application code for direct or indirect calls to old(), form_helper, RedirectResponse::withInput(), and redirect()->withInput().
  • Invalidate active session data after upgrading to purge any attacker-staged serialized payloads from flashdata stores.

Patch Information

The maintainers fixed the issue in CodeIgniter4 4.1.6. The remediation is shipped in commit ce95ed5765256e2f09f3513e7d42790e0d6948f5, which removes the unsafe deserialization path used by the input redisplay helpers. Full disclosure is available in the CodeIgniter4 Security Advisory GHSA-w6jr-wj64-mc9x.

Workarounds

  • If upgrade is not immediately feasible, stop using the old() function and the form_helper across views and controllers.
  • Replace RedirectResponse::withInput() and redirect()->withInput() calls with explicit, type-validated repopulation logic.
  • Restrict session storage backends to server-side stores and rotate session secrets after deploying mitigations.
bash
# Upgrade CodeIgniter4 via Composer to the patched release
composer require codeigniter4/framework:^4.1.6
composer update codeigniter4/framework
php spark --version

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 Probability9.94%

  • 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 Update

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

  • CVE-2022-24711: CodeIgniter4 RCE Vulnerability

  • CVE-2026-41890: CI4MS Authentication Bypass Vulnerability

  • CVE-2026-41201: CI4MS Privilege Escalation Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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