GHSA-x7p5-p2c9-phvg Unexpected database bindings
Attackers can manipulate query bindings by sending arrays for non-array fields, potentially causing the query builder to return unexpected results.
- Exploited in the wild
- Not known
- Login needed
- Not stated
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-x7p5-p2c9-phvg?
GHSA-x7p5-p2c9-phvg is a SQL injection vulnerability in illuminate/database, published on 2 Feb 2021. It can be exploited over the network, with no action from the victim.
Official description
This is a follow-up to the previous security advisory (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-x7p5-p2c9-phvg?
12 open source packages ship an affected version, including illuminate/database and laravel/framework.
| Package | Affected | Fixed in |
|---|---|---|
illuminate/database Packagist | All versions | 6.20.14 |
illuminate/database Packagist | All versions | 6.20.14 |
illuminate/database Packagist | From 7.0.0 | 7.30.4 |
illuminate/database Packagist | From 7.0.0 | 7.30.4 |
illuminate/database Packagist | From 8.0.0 | 8.24.0 |
illuminate/database Packagist | From 8.0.0 | 8.24.0 |
6 more packages
laravel/framework Packagist | All versions | 6.20.14 |
laravel/framework Packagist | All versions | 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-x7p5-p2c9-phvg?
Upgrade illuminate/database to a fixed version for your release line: 6.20.14, 7.30.4 or 8.24.0.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is GHSA-x7p5-p2c9-phvg being exploited?
There is no known exploitation of GHSA-x7p5-p2c9-phvg in the wild and no public exploit code.