5.3medium
Blade `@parent` Exploitation Leading To Possible XSS in Laravel
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.83% (higher than 58% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-66hf-2p6w-jqfw
Description
Laravel is a web application framework. Laravel prior to versions 8.75.0, 7.30.6, and 6.20.42 contain a possible cross-site scripting (XSS) vulnerability in the Blade templating engine. A broken HTML element may be clicked and the user taken to another location in their browser due to XSS. This is due to the user being able to guess the parent placeholder SHA-1 hash by trying common names of sections. If the parent template contains an exploitable HTML structure an XSS vulnerability can be exposed. This vulnerability has been patched in versions 8.75.0, 7.30.6, and 6.20.42 by determining the parent placeholder at runtime and using a random hash that is unique to each request.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| laravel framework | >= 8.0.0, < 8.75.0, >= 7.0.0, < 7.30.6, < 6.20.42, before 6.20.42, from 7.0.0 before 7.30.6, from 8.0.0 before 8.75.0 | CVE List, NVD |
| laravel/framework (Packagist) | before 6.20.42, from 7.0.0 before 7.30.6, from 8.0.0 before 8.75.0 | GitHub Advisory Database |
| illuminate/view (Packagist) | before 6.20.42, from 7.0.0 before 7.30.6, from 8.0.0 before 8.75.0 | GitHub Advisory Database |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N |
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
Laravel is a web application framework. Laravel prior to versions 8.75.0, 7.30.6, and 6.20.42 contain a possible cross-site scripting (XSS) vulnerability in the Blade templating engine. A broken HTML element may be clicked and the user taken to another location in their browser due to XSS. This is due to the user being able to guess the parent placeholder SHA-1 hash by trying common names of sections. If the parent template contains an exploitable HTML structure an XSS vulnerability can be exposed. This vulnerability has been patched in versions 8.75.0, 7.30.6, and 6.20.42 by determining the parent placeholder at runtime and using a random hash that is unique to each request.
GitHub Advisory Database
A security researcher has disclosed a possible XSS vulnerability in the Blade templating engine.
Given the following two Blade templates:
resources/views/parent.blade.php:
@section('content')
<input value="{{ $value }}">
@show
resources/views/child.blade.php:
@extends('parent')
@section('content')
<input value="{{ $value }}">
@endsection
And a route like the following:
Route::get('/example', function() {
$value = '//localhost/###parent-placeholder-040f06fd774092478d450774f5ba30c5da78acc8## onclick=location.assign(this.value);//';
return view('child', ['value' => $value]);
});
The broken HTML element may be clicked and the user is taken to another location in their browser due to XSS. This is due to the user being able to guess the parent placeholder SHA-1 hash by trying common names of sections. If the parent template contains an exploitable HTML structure an XSS vulnerability can be exposed.
This vulnerability has been patched by determining the parent placeholder at runtime and using a random hash that is unique to each request.
NVD (es)
Laravel es un framework de aplicaciones web. Laravel versiones anteriores a 8.75.0, 7.30.6 y 6.20.42, contiene una posible vulnerabilidad de tipo cross-site scripting (XSS) en el motor de plantillas Blade. Puede hacerse clic en un elemento HTML roto y llevar al usuario a otra ubicación en su navegador debido a un ataque de tipo XSS. Esto es debido a que el usuario puede adivinar el hash SHA-1 del marcador de posición padre al probar los nombres comunes de las secciones. Si la plantilla padre contiene una estructura HTML explotable puede exponerse una vulnerabilidad de tipo XSS. Esta vulnerabilidad ha sido parcheada en las versiones 8.75.0, 7.30.6 y 6.20.42 determinando el marcador de posición padre en tiempo de ejecución y usando un hash aleatorio que es único para cada petición
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-43808 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-66hf-2p6w-jqfw changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-43808 changed 2026-06-17 | Public domain |