CVE-2022-21647: Deserialization of Untrusted Data in Codeigniter4

codeigniter4/framework Updated 02 Oct 2025

Summary

06/01/2022
Yes i
High
7.7

CVE-2022-21647: Deserialization of Untrusted Data in Codeigniter4. Affects codeigniter4/framework versions < 4.1.6. Fixed in 4.1.6. How to fix ↓

Also tracked for

The same CVE-2022-21647 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

CodeIgniter4 is a popular PHP framework used for developing web applications. It provides a set of libraries and tools that simplify the development process. The framework is known for its simplicity, performance, and security. However, a vulnerability has been discovered in CodeIgniter4 that allows for the deserialization of untrusted data. This vulnerability can be exploited by remote attackers to inject auto-loadable arbitrary objects, potentially leading to the execution of existing PHP code on the server. It is important to address this vulnerability to prevent potential SQL injection attacks.

Vulnerability Detail

The vulnerability exists in the old() function in CodeIgniter4. This function is used to retrieve old input data from forms. However, it does not properly validate the input data, allowing for the deserialization of untrusted data. This can be exploited by remote attackers to inject malicious objects, which may lead to the execution of arbitrary PHP code on the server. This vulnerability has a CVSS score of 7.7, indicating a high severity level. It is crucial to upgrade to CodeIgniter4 version 4.1.6 or later to mitigate this vulnerability.

How To Fix

Minimum fixed version

4.1.6

This is the first release that contains the fix.

composer require codeigniter4/framework:4.1.6

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, there are some workarounds that can be implemented. Avoid using the old() function and the form_helper in your code. Additionally, refrain from using the RedirectResponse::withInput() and redirect()->withInput() methods. By avoiding these functions and methods, you reduce the risk of deserialization attacks. However, it is still recommended to upgrade to the latest version as soon as possible to fully address the vulnerability.

Conclusion

The deserialization vulnerability in CodeIgniter4 poses a significant risk to the security of web applications. It allows for the injection of malicious objects and potential execution of arbitrary PHP code on the server. To mitigate this vulnerability, it is crucial to upgrade to CodeIgniter4 version 4.1.6 or later. Additionally, it is recommended to follow secure coding practices and regularly update dependencies to stay protected against known vulnerabilities. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for codeigniter4/framework →

Share this vulnerability

FAQ

The vulnerability allows for the deserialization of untrusted data, which can lead to the injection of malicious objects. This may result in the execution of arbitrary PHP code on the server, potentially leading to SQL injection attacks.

To mitigate this vulnerability, it is recommended to upgrade to CodeIgniter4 version 4.1.6 or later. This version includes a patch that addresses the deserialization issue.

Yes, there is a known exploit for this vulnerability that can lead to SQL injection. It is important to upgrade to the latest version of CodeIgniter4 to prevent exploitation.

While there are workarounds available, such as avoiding certain functions and methods, it is still recommended to upgrade to the latest version of CodeIgniter4. Workarounds may reduce the risk, but upgrading provides a comprehensive fix for the vulnerability.

For more information about this vulnerability, you can visit the official CodeIgniter4 GitHub repository and check the security advisory. You can also reach out to the CodeIgniter4 team via email for any specific questions or concerns.

Related vulnerabilities

Recent vulnerabilities recorded for codeigniter4/framework.

How To Fix

Minimum fixed version

4.1.6

This is the first release that contains the fix.

composer require codeigniter4/framework:4.1.6

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback