Advisory

GHSA-66hf-2p6w-jqfw

Also known as: CVE-2021-43808

Summary

Laravel Framework XSS in Blade templating engine

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2021-12-08 19:57 UTC
Modified
2026-07-08 06:27 UTC

Affected packages and fixes

laravel/framework

Packagist · All systems

Affected

  • introduced 0, fixed 6.20.42 (ecosystem)

Fixed versions

6.20.42

Fix

The export has no generic command for this ecosystem.

laravel/framework

Packagist · All systems

Affected

  • introduced 7.0.0, fixed 7.30.6 (ecosystem)

Fixed versions

7.30.6

Fix

The export has no generic command for this ecosystem.

laravel/framework

Packagist · All systems

Affected

  • introduced 8.0.0, fixed 8.75.0 (ecosystem)

Fixed versions

8.75.0

Fix

The export has no generic command for this ecosystem.

illuminate/view

Packagist · All systems

Affected

  • introduced 0, fixed 6.20.42 (ecosystem)

Fixed versions

6.20.42

Fix

The export has no generic command for this ecosystem.

illuminate/view

Packagist · All systems

Affected

  • introduced 7.0.0, fixed 7.30.6 (ecosystem)

Fixed versions

7.30.6

Fix

The export has no generic command for this ecosystem.

illuminate/view

Packagist · All systems

Affected

  • introduced 8.0.0, fixed 8.75.0 (ecosystem)

Fixed versions

8.75.0

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences