Medium

Laravel Framework XSS in Blade templating engine

  • Disclosed: 08.12.2021
  • Updated: 11.10.2026 10:22

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:

html
@section('content')
<input value="{{ $value }}">
@show

resources/views/child.blade.php:

html
@extends('parent')

@section('content')
<input value="{{ $value }}">
@endsection

And a route like the following:

php
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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package illuminate/view < 6.20.42, >= 7.0.0, < 7.30.6, >= 8.0.0, < 8.75.0 6.20.42, 7.30.6, 8.75.0
Composer package laravel/framework < 6.20.42, >= 7.0.0, < 7.30.6, >= 8.0.0, < 8.75.0 6.20.42, 7.30.6, 8.75.0

References

CVSS score 6.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness (CWE)
CWE-327, CWE-79
Platform
Composer
Package
illuminate/view, laravel/framework
Disclosed
08.12.2021
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-66hf-2p6w-jqfw - CC BY 4.0

Vulnerability history: laravel/framework

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (26) in the archive
Total entries
26
First → latest
01.2021 09.2026
Without a fix
0
Exploited in attacks
1

Severity breakdown

  • Critical 2
  • High 11
  • Medium 12
  • Low 1

Disclosures per year

  1. 2021: 5
  2. 2022: 5
  3. 2023: 0
  4. 2024: 10
  5. 2025: 3
  6. 2026: 3
Severity:
  1. High · 8.9 CVE-2026-48019 >= 13.0.0, < 13.10.0, < 12.60.0 13.10.0, 12.60.0
  2. High · 0.0 CVE-2024-52301 < 6.20.45, >= 7.0.0, < 7.30.7, >= 8.0.0, < 8.83.28, >= 9.0.0, < 9.52.17, >= 10.0.0, < 10.48.23, >= 11.0.0, < 11.31.0 6.20.45, 7.30.7, 8.83.28, 9.52.17, 10.48.23, 11.31.0
  3. High ghsa-wq8p-mqvg-2p5h >= 6.0.0, < 6.20.26, >= 7.0.0, < 7.30.5, >= 8.0.0, < 8.40.0 6.20.26, 7.30.5, 8.40.0
  4. High ghsa-jwvj-pwww-3mj5 >= 6.0.0, < 6.20.14, >= 7.0.0, < 7.30.4, >= 8.0.0, < 8.24.0 6.20.14, 7.30.4, 8.24.0
  5. Critical · 9.9 ghsa-qm5c-m76r-2hfr >= 4.1.0, < 6.18.31, >= 7.0.0, < 7.22.4 6.18.31, 7.22.4
  6. High ghsa-6jvx-8ch9-j2jr >= 5.5.0, < 5.6.30 5.6.30
  7. Critical · 9.8 CVE-2019-9081 >= 5.7.0, < 6.20.44 6.20.44
  8. High · 8.1 Exploited in attacks CVE-2018-15133 <= 5.5.40, >= 5.6.0, < 5.6.30 5.6.30
  9. High · 8.8 CVE-2020-19316 < 5.8.17 5.8.17
  10. Laravel Framework XSS in Blade templating engine this entry
    Medium · 6.1 CVE-2021-43808 < 6.20.42, >= 7.0.0, < 7.30.6, >= 8.0.0, < 8.75.0 6.20.42, 7.30.6, 8.75.0
  11. High · 7.5 CVE-2020-24941 < 6.18.35, >= 7.0.0, < 7.24.0 6.18.35, 7.24.0
  12. High ghsa-4mg9-vhxq-vm7j >= 8.0.0, < 8.40.0, < 6.20.26 8.40.0, 6.20.26
  13. High · 7.2 ghsa-x7p5-p2c9-phvg < 6.20.14, >= 7.0.0, < 7.30.4, >= 8.0.0, < 8.24.0 6.20.14, 7.30.4, 8.24.0
  14. High · 7.2 CVE-2021-21263 >= 8.0.0, < 8.22.1, >= 6.0.0, < 6.20.11, >= 7.0.0, < 7.30.2 8.22.1, 6.20.11, 7.30.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.