CVE-2022-21715
MEDIUM 6.1CVSS 3.1Cross-site Scripting Vulnerability in CodeIgniter4
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.
- Published
- 24 Jan 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- BIT-codeigniter-2022-21715GHSA-7528-7jg5-6g62
- Sources
- NVDJSONOSV GHSA-7528-7jg5-6g62JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | codeigniter | codeignitercpe:2.3:a:codeigniter:codeigniter:*:*:*:*:*:*:*:* |
>= 4.0.0, < 4.1.8 | 4.1.8 |
| OSV | Packagist | codeigniter4/framework | < 4.1.8 | 4.1.8 |
References
- https://codeigniter4.github.io/userguide/incoming/routing.html#use-defined-routes-only · Mitigation, Vendor Advisory, WEB
- https://github.com/codeigniter4/CodeIgniter4/commit/70d881cf5322b7c32e69516aebd2273ac6a1e8dd · Patch, Third Party Advisory, WEB
- https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-7528-7jg5-6g62 · Mitigation, Third Party 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
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 24 Jan 2022)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 27 Jan 2022)