What’s Vulnerable › Vulnerabilities
CVE-2022-21715: Cross-site Scripting Vulnerability in CodeIgniter4
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 1.0% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-01-24 · updated 2026-06-17
- Weakness: CWE-79
Description
CodeIgniter4 is the 4.x branch of CodeIgniter, a PHP full-stack web framework. A cross-site scripting (XSS) vulnerability was found in `API\ResponseTrait` in Codeigniter4 prior to version 4.1.8. Attackers can do XSS attacks if a potential victim is using `API\ResponseTrait`. Version 4.1.8 contains a patch for this vulnerability. There are two potential workarounds available. Users may avoid using `API\ResponseTrait` or `ResourceController` Users may also disable Auto Route and use defined routes only.
Affected products
- CodeIgniter4: from 4.0.0 before 4.1.8 — fixed in 4.1.8
How to fix
Upgrade to a fixed version: CodeIgniter4 4.1.8. Check the vendor advisory for mitigations.
References
- https://codeigniter4.github.io/userguide/incoming/routing.html#use-defined-routes-only
- https://github.com/codeigniter4/CodeIgniter4/commit/70d881cf5322b7c32e69516aebd2273ac6a1e8dd
- https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-7528-7jg5-6g62
- https://codeigniter4.github.io/userguide/incoming/routing.html#use-defined-routes-only
- https://github.com/codeigniter4/CodeIgniter4/commit/70d881cf5322b7c32e69516aebd2273ac6a1e8dd
- https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-7528-7jg5-6g62
Get alerted when CVE-2022-21715 or the next vulnerability affects your stack