# GHSA-76w8-mqx4-wjrf: Doctrine DBAL SQL injection possibility

> SQL injection vulnerability in Doctrine DBAL identifier quoting allows attackers to manipulate database queries when user input is used.

- **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:** 15 May 2024

## What is GHSA-76w8-mqx4-wjrf?

GHSA-76w8-mqx4-wjrf is a SQL injection vulnerability in doctrine/dbal, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The identifier quoting in Doctrine DBAL has a potential security problem when user-input is passed into this function, making the security aspect of this functionality obsolete.
If you make use of AbstractPlatform::quoteIdentifier() or Doctrine::quoteIdentifier() please upgrade immediately. The ORM itself does not use identifier quoting in combination with user-input, however we still urge everyone to update to the latest version of DBAL.

## Which versions are affected by GHSA-76w8-mqx4-wjrf?

4 open source packages ship an affected version, including doctrine/dbal.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `doctrine/dbal` | Packagist | From 2.0.0 | 2.0.8 |
| `doctrine/dbal` | Packagist | From 2.0.0 | 2.0.8 |
| `doctrine/dbal` | Packagist | From 2.1.0 | 2.1.2 |
| `doctrine/dbal` | Packagist | From 2.1.0 | 2.1.2 |

## How do I fix GHSA-76w8-mqx4-wjrf?

Upgrade doctrine/dbal to a fixed version for your release line: 2.0.8 or 2.1.2.

## Is GHSA-76w8-mqx4-wjrf being exploited?

There is no known exploitation of GHSA-76w8-mqx4-wjrf in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-76w8-mqx4-wjrf and fix it if it is affected.

What it is: GHSA-76w8-mqx4-wjrf is a SQL injection vulnerability in doctrine/dbal, published on 15 May 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-76w8-mqx4-wjrf in the wild and no public exploit code.

Affected packages and fixed versions:
- doctrine/dbal (Packagist): affected from 2.0.0; fixed in 2.0.8
- doctrine/dbal (Packagist): affected from 2.0.0; fixed in 2.0.8
- doctrine/dbal (Packagist): affected from 2.1.0; fixed in 2.1.2
- doctrine/dbal (Packagist): affected from 2.1.0; fixed in 2.1.2

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-76w8-mqx4-wjrf/ (Markdown: https://insights.sbomify.com/GHSA-76w8-mqx4-wjrf/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-76w8-mqx4-wjrf

---
From sbomify Insights: https://insights.sbomify.com/GHSA-76w8-mqx4-wjrf/
Summaries are generated and may contain mistakes; the official description above is the record.
