# GHSA-jwvj-pwww-3mj5: laravel framework Unexpected database bindings via requests

> Attackers can manipulate query bindings via crafted array inputs to retrieve unexpected data from the database.

- **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-jwvj-pwww-3mj5?

GHSA-jwvj-pwww-3mj5 is a SQL injection vulnerability in laravel/framework, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

This is a follow-up to the security advisory https://github.com/laravel/framework/security/advisories/GHSA-3p32-j457-pg5x which addresses a few additional edge cases.

If a request is crafted where a field that is normally a non-array value is an array, and that input is not validated or cast to its expected type before being passed to the query builder, an unexpected number of query bindings can be added to the query. In some situations, this will simply lead to no results being returned by the query builder; however, it is possible certain queries could be affected in a way that causes the query to return unexpected results.

## Which versions are affected by GHSA-jwvj-pwww-3mj5?

6 open source packages ship an affected version, including laravel/framework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `laravel/framework` | Packagist | From 6.0.0 | 6.20.14 |
| `laravel/framework` | Packagist | From 6.0.0 | 6.20.14 |
| `laravel/framework` | Packagist | From 7.0.0 | 7.30.4 |
| `laravel/framework` | Packagist | From 7.0.0 | 7.30.4 |
| `laravel/framework` | Packagist | From 8.0.0 | 8.24.0 |
| `laravel/framework` | Packagist | From 8.0.0 | 8.24.0 |

## How do I fix GHSA-jwvj-pwww-3mj5?

Upgrade laravel/framework to a fixed version for your release line: 6.20.14, 7.30.4 or 8.24.0.

## Is GHSA-jwvj-pwww-3mj5 being exploited?

There is no known exploitation of GHSA-jwvj-pwww-3mj5 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-jwvj-pwww-3mj5 and fix it if it is affected.

What it is: GHSA-jwvj-pwww-3mj5 is a SQL injection vulnerability in laravel/framework, 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-jwvj-pwww-3mj5 in the wild and no public exploit code.

Affected packages and fixed versions:
- laravel/framework (Packagist): affected from 6.0.0; fixed in 6.20.14
- laravel/framework (Packagist): affected from 6.0.0; fixed in 6.20.14
- laravel/framework (Packagist): affected from 7.0.0; fixed in 7.30.4
- laravel/framework (Packagist): affected from 7.0.0; fixed in 7.30.4
- laravel/framework (Packagist): affected from 8.0.0; fixed in 8.24.0
- laravel/framework (Packagist): affected from 8.0.0; fixed in 8.24.0

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-jwvj-pwww-3mj5/ (Markdown: https://insights.sbomify.com/GHSA-jwvj-pwww-3mj5/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-jwvj-pwww-3mj5

---
From sbomify Insights: https://insights.sbomify.com/GHSA-jwvj-pwww-3mj5/
Summaries are generated and may contain mistakes; the official description above is the record.
