CVE-2022-21715: XSS Vulnerability in API\ResponseTrait in CodeIgniter4
Impact Cross-Site Scripting (XSS) vulnerability was found in API\ResponseTrait in Codeigniter4. Attackers can do XSS attacks if you are using API\ResponseTrait.
Patches Upgrade to v4.1.8 or later.
Workarounds Do one of the following: 1. Do not use API\ResponseTrait nor ResourceController 2. Disable Auto Route and Use Defined Routes Only
References - Cross Site Scripting (XSS) Software Attack | OWASP Foundation
For more information If you have any questions or comments about this advisory: Open an issue in codeigniter4/CodeIgniter4 Email us at SECURITY.md
Other sources
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.
— NVD
CVE-2022-21715: XSS Vulnerability in API\ResponseTrait in CodeIgniter4
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/codeigniter4/frameworkto a version that resolves this vulnerability.Fixed in 4.1.8 - Upgrade
Upgrade
CodeIgniter4to a version that resolves this vulnerability.Fixed in 4.1.8 - Configuration
Disable Auto Route and use defined routes only.
CodeIgniter4 routing Auto Route = disabled; use defined routes only - Compensating control
Do not use API\ResponseTrait or ResourceController.
Event History
Frequently Asked Questions
What is the severity of CVE-2022-21715?
CVE-2022-21715 is a medium severity vulnerability due to its potential for Cross-Site Scripting (XSS) attacks.
How do I fix CVE-2022-21715?
To fix CVE-2022-21715, upgrade your CodeIgniter4 version to 4.1.8 or later.
What component is affected by CVE-2022-21715?
CVE-2022-21715 affects the 'API\ResponseTrait' component in CodeIgniter4.
What is the exploitability of CVE-2022-21715?
CVE-2022-21715 can be exploited by attackers to perform XSS attacks in applications using the affected component.
Are there any workarounds for CVE-2022-21715?
A workaround for CVE-2022-21715 is to avoid using the 'API\ResponseTrait' until an upgrade is performed.