Vulnerability advisory

GHSA-66hf-2p6w-jqfw

Laravel Framework XSS in Blade templating engine

Published Updated OSV record ↗

Also known as CVE-2021-43808

Severity
  • CVSS 3.xCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected versions

AffectedFixed in
All versions before 6.20.426.20.42Advisories →
Also listed as affected (551)
7.0.0 to before 7.30.67.30.6Advisories →
Also listed as affected (79)
8.0.0 to before 8.75.08.75.0Advisories →
Also listed as affected (112)
AffectedFixed in
All versions before 6.20.426.20.42Advisories →
Also listed as affected (326)
7.0.0 to before 7.30.67.30.6Advisories →
Also listed as affected (79)
8.0.0 to before 8.75.08.75.0Advisories →
Also listed as affected (110)

Description

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.

References

  • Codex
  • Claude Code
  • VS Code
  • GitHub Copilot
  • Cursor
  • Cline
  • Windsurf
  • Google Anti-gravity
  • OpenCode
  • Pi
  • Gemini CLI
  • Hermes Agent
  • Zed
  • Junie
  • Qwen Code
  • Kiro
  • Kilo Code
  • Factory Droid

Set up GitHits for your agents

Run this command:

<> bash
npx githits@latest init

What happens next:

  1. Opens your browser to authorize GitHits
  2. Asks whether to set up GitHits at the user or project level
  3. Detects your supported AI coding tools
  4. Lets you choose which tools to configure
  5. Configures the selected tools