# GHSA-q9j3-4ghj-6h57: Inadequate XSS Prevention in CodeIgniter/Framework Security Library

> The CodeIgniter Framework Security Library failed to properly sanitize input, allowing attackers to bypass XSS protections and execute scripts in user browsers.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 May 2024

## What is GHSA-q9j3-4ghj-6h57?

GHSA-q9j3-4ghj-6h57 is a cross-site scripting vulnerability in codeigniter/framework, published on 15 May 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

The xss_clean() method in the Security Library of CodeIgniter/Framework, specifically in versions before 3.0.3, exhibited a vulnerability that allowed certain Cross-Site Scripting (XSS) vectors to bypass its intended protection mechanisms.

The xss_clean() method is designed to sanitize input data by removing potentially malicious content, thus preventing XSS attacks. However, in versions prior to 3.0.3, it was discovered that the method did not adequately mitigate specific XSS vectors, leaving a potential security gap.

## Which versions are affected by GHSA-q9j3-4ghj-6h57?

2 open source packages ship an affected version, including codeigniter/framework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `codeigniter/framework` | Packagist | All versions | 3.0.3 |
| `codeigniter/framework` | Packagist | All versions | 3.0.3 |

## How do I fix GHSA-q9j3-4ghj-6h57?

Upgrade codeigniter/framework to 3.0.3 or later.

## Is GHSA-q9j3-4ghj-6h57 being exploited?

There is no known exploitation of GHSA-q9j3-4ghj-6h57 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-q9j3-4ghj-6h57 and fix it if it is affected.

What it is: GHSA-q9j3-4ghj-6h57 is a cross-site scripting vulnerability in codeigniter/framework, published on 15 May 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-q9j3-4ghj-6h57 in the wild and no public exploit code.

Affected packages and fixed versions:
- codeigniter/framework (Packagist): affected all versions; fixed in 3.0.3
- codeigniter/framework (Packagist): affected all versions; fixed in 3.0.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-q9j3-4ghj-6h57/ (Markdown: https://insights.sbomify.com/GHSA-q9j3-4ghj-6h57/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-q9j3-4ghj-6h57

---
From sbomify Insights: https://insights.sbomify.com/GHSA-q9j3-4ghj-6h57/
Summaries are generated and may contain mistakes; the official description above is the record.
