7.2high
Query Binding Exploitation in Laravel
- Severity
- 7.2high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.63% (higher than 76% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-3p32-j457-pg5xBIT-LARAVEL-2021-21263
Description
Laravel is a web application framework. Versions of Laravel before 6.20.11, 7.30.2 and 8.22.1 contain a query binding exploitation. This same exploit applies to the illuminate/database package which is used by Laravel. 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| laravel framework | >= 6.0.0, < 6.20.11, >= 7.0.0, < 7.30.2, >= 8.0.0, < 8.22.1 | CVE List |
| laravel/framework (Packagist) | from 8.0.0 before 8.22.1, from 6.0.0 before 6.20.11, from 7.0.0 before 7.30.2 | GitHub Advisory Database |
| illuminate/database (Packagist) | from 7.0.0 before 7.30.3, from 8.0.0 before 8.22.1, from 6.0.0 before 6.20.12 | GitHub Advisory Database |
| laravel laravel | from 6.0.0 before 6.20.11, from 7.0.0 before 7.30.2, from 8.0.0 before 8.22.1 | NVD |
| laravel (Bitnami) | from 6.0.0 before 6.20.11, from 7.0.0 before 7.30.2, from 8.0.0 before 8.22.1 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 7.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N |
| GitHub | 7.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:P/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
What each source says
CVE List
Laravel is a web application framework. Versions of Laravel before 6.20.11, 7.30.2 and 8.22.1 contain a query binding exploitation. This same exploit applies to the illuminate/database package which is used by Laravel. 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.
GitHub Advisory Database
Description
Laravel versions <6.20.12, <7.30.3 & <8.22.1 contain a query binding exploitation.
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.
This vulnerability was discovered by Tim Groenevelt (tim.g@foodbyus.com).
References
NVD (es)
Laravel es un framework de aplicación web. Las versiones de Laravel anteriores a 6.20.11, 7.30.2 y 8.22.1 contienen una explotación de enlace de consultas. Esta misma explotación se aplica al paquete illuminate/database que usa Laravel. Si una petición es diseñada donde un campo que normalmente es un valor que no es una matriz es una matriz, y esa entrada no es comprobada ni se convierte al tipo esperado antes de pasarla al generador de consultas, una cantidad inesperada de enlaces de consulta pueden ser agregadas a la consulta. En algunas situaciones, esto simplemente conllevará a que el generador de consultas no devuelva resultados; sin embargo, es posible que determinadas consultas estén afectadas de forma que cause que la consulta devuelva resultados inesperados
References
| https://github.com/laravel/framework/security/advisories/GHSA-3p32-j457-pg5x | third-party-advisory, web | |
| https://github.com/laravel/framework/pull/35865 | patch, third-party-advisory, web | |
| https://blog.laravel.com/security-laravel-62011-7302-8221-released | vendor-advisory, web | |
| https://packagist.org/packages/laravel/framework | product, third-party-advisory, web | |
| https://packagist.org/packages/illuminate/database | product, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-21263 | advisory, web | |
| https://blog.laravel.com/security-laravel-62012-7303-released | web | |
| https://github.com/FriendsOfPHP/security-advisories/blob/master/illuminate/database/CVE-2021-21263.yaml | web | |
| https://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/CVE-2021-21263.yaml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21263 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3p32-j457-pg5x changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2021-21263 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-LARAVEL-2021-21263 changed 2025-05-20 | Apache-2.0 |