5.4medium
Cross-site Scripting Vulnerability in CodeIgniter4
- Severity
- 5.4medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.94% (higher than 59% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-7528-7jg5-6g62BIT-CODEIGNITER-2022-21715
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
| Product or package | Versions | Reported by |
|---|---|---|
| codeigniter4 CodeIgniter4 | < 4.1.8 | CVE List |
| codeigniter4/framework (Packagist) | before 4.1.8 | GitHub Advisory Database |
| codeigniter codeigniter | from 4.0.0 before 4.1.8 | NVD |
| codeigniter (Bitnami) | from 4.0.0 before 4.1.8 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| GitHub | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
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:
- Do not use
API\ResponseTraitnorResourceController - Disable Auto Route and Use Defined Routes Only
References
For more information
If you have any questions or comments about this advisory:
- Open an issue in codeigniter4/CodeIgniter4
- Email us at SECURITY.md
NVD (es)
CodeIgniter4 es la rama versión 4.x de CodeIgniter, un framework web PHP full-stack. Se ha encontrado una vulnerabilidad de tipo cross-site scripting (XSS) en "API\ResponseTrait" en Codeigniter4 versiones anteriores a 4.1.8. Los atacantes pueden realizar ataques de tipo XSS si una víctima potencial está usando "API\ResponseTrait". La versión 4.1.8, contiene un parche para esta vulnerabilidad. Se presentan dos posibles soluciones disponibles. Los usuarios pueden evitar el uso de "APIResponseTrait" o "ResourceController" Los usuarios también pueden deshabilitar la Ruta Automática y usar sólo las rutas definidas
References
| https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-7528-7jg5-6g62 | mitigation, third-party-advisory, web | |
| https://github.com/codeigniter4/CodeIgniter4/commit/70d881cf5322b7c32e69516aebd2273ac6a1e8dd | patch, third-party-advisory, web | |
| https://codeigniter4.github.io/userguide/incoming/routing.html#use-defined-routes-only | mitigation, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-21715 | advisory | |
| https://github.com/FriendsOfPHP/security-advisories/blob/master/codeigniter4/framework/CVE-2022-21715.yaml | web | |
| https://github.com/codeigniter4/framework | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-21715 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7528-7jg5-6g62 changed 2024-02-16 | CC-BY-4.0 |
| NVD | CVE-2022-21715 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-CODEIGNITER-2022-21715 changed 2024-03-06 | Apache-2.0 |