CVE-2021-43808

CVE-2021-43808 is a medium-severity cross-site scripting (XSS) vulnerability in laravel/framework (composer), affecting versions < 6.20.42. It is fixed in 6.20.42, 7.30.6, 8.75.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Laravel Framework XSS in Blade templating engine

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.

Impact

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

CVE-2021-43808 has a CVSS score of 6.1 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (6.20.42, 7.30.6, 8.75.0); upgrading removes the vulnerable code path.

Affected versions

laravel/framework (< 6.20.42) laravel/framework (>= 7.0.0, < 7.30.6) laravel/framework (>= 8.0.0, < 8.75.0) illuminate/view (< 6.20.42) illuminate/view (>= 7.0.0, < 7.30.6) illuminate/view (>= 8.0.0, < 8.75.0)

Security releases

laravel/framework → 6.20.42 (composer) laravel/framework → 7.30.6 (composer) laravel/framework → 8.75.0 (composer) illuminate/view → 6.20.42 (composer) illuminate/view → 7.30.6 (composer) illuminate/view → 8.75.0 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade the following packages to resolve this vulnerability:

laravel/framework to 6.20.42 or later; laravel/framework to 7.30.6 or later; laravel/framework to 8.75.0 or later; illuminate/view to 6.20.42 or later; illuminate/view to 7.30.6 or later; illuminate/view to 8.75.0 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2021-43808? CVE-2021-43808 is a medium-severity cross-site scripting (XSS) vulnerability in laravel/framework (composer), affecting versions < 6.20.42. It is fixed in 6.20.42, 7.30.6, 8.75.0. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2021-43808? CVE-2021-43808 has a CVSS score of 6.1 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2021-43808?
    • laravel/framework (composer) (versions < 6.20.42)
    • illuminate/view (composer) (versions < 6.20.42)
  4. Is there a fix for CVE-2021-43808? Yes. CVE-2021-43808 is fixed in 6.20.42, 7.30.6, 8.75.0. Upgrade to this version or later.
  5. Is CVE-2021-43808 exploitable, and should I be worried? Whether CVE-2021-43808 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2021-43808 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2021-43808?
    • Upgrade laravel/framework to 6.20.42 or later
    • Upgrade laravel/framework to 7.30.6 or later
    • Upgrade laravel/framework to 8.75.0 or later
    • Upgrade illuminate/view to 6.20.42 or later
    • Upgrade illuminate/view to 7.30.6 or later
    • Upgrade illuminate/view to 8.75.0 or later

Other vulnerabilities in laravel/framework

Stop the waste.
Protect your environment with Kodem.