Lucene search

K
githubGitHub Advisory DatabaseGHSA-66HF-2P6W-JQFW
HistoryDec 08, 2021 - 7:57 p.m.

Laravel Framework XSS in Blade templating engine

2021-12-0819:57:36
CWE-79
CWE-327
GitHub Advisory Database
github.com
17
security researcher
blade templating
xss vulnerability
html structure
runtime hash
patched vulnerability
laravel framework

CVSS2

4.3

Attack Vector

NETWORK

Attack Complexity

MEDIUM

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:M/Au:N/C:N/I:P/A:N

CVSS3

6.1

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

REQUIRED

Scope

CHANGED

Confidentiality Impact

LOW

Integrity Impact

LOW

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

EPSS

0.001

Percentile

50.0%

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.

Affected configurations

Vulners
Node
illuminateviewRange8.0.08.75.0
OR
illuminateviewRange7.0.07.30.6
OR
illuminateviewRange<6.20.42
OR
laravelframeworkRange8.0.08.75.0
OR
laravelframeworkRange7.0.07.30.6
OR
laravelframeworkRange<6.20.42
VendorProductVersionCPE
illuminateview*cpe:2.3:a:illuminate:view:*:*:*:*:*:*:*:*
laravelframework*cpe:2.3:a:laravel:framework:*:*:*:*:*:*:*:*

CVSS2

4.3

Attack Vector

NETWORK

Attack Complexity

MEDIUM

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:M/Au:N/C:N/I:P/A:N

CVSS3

6.1

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

REQUIRED

Scope

CHANGED

Confidentiality Impact

LOW

Integrity Impact

LOW

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

EPSS

0.001

Percentile

50.0%