CVE-2021-43808 Blade `@parent` Exploitation Leading To Possible XSS in Laravel
Attackers can exploit Blade template placeholders to inject malicious scripts, leading to cross-site scripting attacks against users.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-43808?
CVE-2021-43808 is a medium-severity cross-site scripting vulnerability in laravel framework, published on 7 Dec 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Which versions are affected by CVE-2021-43808?
12 open source packages ship an affected version, including laravel/framework and illuminate/view. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
laravel/framework Packagist | All versions | 6.20.42 |
laravel/framework Packagist | All versions | 6.20.42 |
laravel/framework Packagist | From 7.0.0 | 7.30.6 |
laravel/framework Packagist | From 7.0.0 | 7.30.6 |
laravel/framework Packagist | From 8.0.0 | 8.75.0 |
laravel/framework Packagist | From 8.0.0 | 8.75.0 |
6 more packages
illuminate/view Packagist | All versions | 6.20.42 |
illuminate/view Packagist | All versions | 6.20.42 |
illuminate/view Packagist | From 7.0.0 | 7.30.6 |
illuminate/view Packagist | From 7.0.0 | 7.30.6 |
illuminate/view Packagist | From 8.0.0 | 8.75.0 |
illuminate/view Packagist | From 8.0.0 | 8.75.0 |
Products include Laravel Framework.
How do I fix CVE-2021-43808?
Upgrade laravel/framework to a fixed version for your release line: 6.20.42, 7.30.6 or 8.75.0.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2021-43808 being exploited?
There is no known exploitation of CVE-2021-43808 in the wild and no public exploit code.
Other vulnerabilities in laravel framework
Sources
Also known as CLSA-2026-1767919738, CLSA-2026-1770598645, DEBIAN-CVE-2021-43808, GHSA-66hf-2p6w-jqfw.