# GHSA-qf36-fx9f-232x: ZendFramework potential SQL Injection Vector When Using PDO_MySql

> SQL injection possible in Zend Framework when using non-ASCII-compatible encodings with PDO_MySql, allowing attackers to read or modify database contents.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Jun 2024

## What is GHSA-qf36-fx9f-232x?

GHSA-qf36-fx9f-232x is a SQL injection vulnerability in zendframework/zendframework1, published on 7 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Developers using non-ASCII-compatible encodings in conjunction with the MySQL PDO driver of PHP may be vulnerable to SQL injection attacks. Developers using ASCII-compatible encodings like UTF8 or latin1 are not affected by this PHP issue, which is described in more detail here:

http://bugs.php.net/bug.php?id=47802
The PHP Group included a feature in PHP 5.3.6+ that allows any character set information to be passed as part of the DSN in PDO to allow both the database as well as the C-level driver to be aware of which charset is in use which is of special importance when PDO's quoting mechanisms are utilized, which Zend Framework also relies on.

## Which versions are affected by GHSA-qf36-fx9f-232x?

4 open source packages ship an affected version, including zendframework/zendframework1.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `zendframework/zendframework1` | Packagist | From 1.10.0 | 1.10.9 |
| `zendframework/zendframework1` | Packagist | From 1.10.0 | 1.10.9 |
| `zendframework/zendframework1` | Packagist | From 1.11.0 | 1.11.6 |
| `zendframework/zendframework1` | Packagist | From 1.11.0 | 1.11.6 |

## How do I fix GHSA-qf36-fx9f-232x?

Upgrade zendframework/zendframework1 to a fixed version for your release line: 1.10.9 or 1.11.6.

## Is GHSA-qf36-fx9f-232x being exploited?

There is no known exploitation of GHSA-qf36-fx9f-232x in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-qf36-fx9f-232x and fix it if it is affected.

What it is: GHSA-qf36-fx9f-232x is a SQL injection vulnerability in zendframework/zendframework1, published on 7 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-qf36-fx9f-232x in the wild and no public exploit code.

Affected packages and fixed versions:
- zendframework/zendframework1 (Packagist): affected from 1.10.0; fixed in 1.10.9
- zendframework/zendframework1 (Packagist): affected from 1.10.0; fixed in 1.10.9
- zendframework/zendframework1 (Packagist): affected from 1.11.0; fixed in 1.11.6
- zendframework/zendframework1 (Packagist): affected from 1.11.0; fixed in 1.11.6

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-qf36-fx9f-232x/ (Markdown: https://insights.sbomify.com/GHSA-qf36-fx9f-232x/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-qf36-fx9f-232x

---
From sbomify Insights: https://insights.sbomify.com/GHSA-qf36-fx9f-232x/
Summaries are generated and may contain mistakes; the official description above is the record.
