CVE-2021-43808: Laravel/framework Cross-Site Scripting Vulnerability
MODERATECVE-2021-43808 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-327: Use of a Broken or Risky Cryptographic Algorithm) affecting Laravel/framework libraries in the Packagist ecosystem. The issue involves laravel framework xss in blade templating engine. Remediation is available by upgrading affected packages to version 6.20.42, 7.30.6, 8.75.0.
CVE-2021-43808 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2021-43808
To remediate this vulnerability, upgrade all affected Laravel/framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade laravel/framework to 6.20.42
Upgrade laravel/framework to 7.30.6
Upgrade laravel/framework to 8.75.0
Upgrade illuminate/view to 6.20.42
Upgrade illuminate/view to 7.30.6
Upgrade illuminate/view to 8.75.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for laravel/framework
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-43808, inspect your project dependencies for Laravel/framework:
inspect dependencies for laravel/framework
Analyze the terminal output to locate any version of Laravel/framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.20.42), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm, where the product uses a broken or risky cryptographic algorithm or protocol. In Laravel/framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-43808 Affected Laravel/framework Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
laravel/framework
|
Packagist |
< 6.20.42
|
6.20.42
|
|
laravel/framework
|
Packagist |
≥ 7.0.0
< 7.30.6
|
7.30.6
|
|
laravel/framework
|
Packagist |
≥ 8.0.0
< 8.75.0
|
8.75.0
|
|
illuminate/view
|
Packagist |
< 6.20.42
|
6.20.42
|
|
illuminate/view
|
Packagist |
≥ 7.0.0
< 7.30.6
|
7.30.6
|
|
illuminate/view
|
Packagist |
≥ 8.0.0
< 8.75.0
|
8.75.0
|
References
Frequently Asked Questions
What is CVE-2021-43808?
Which Laravel/framework versions are affected?
What version fixes CVE-2021-43808?
Is laravel/framework affected?
Is illuminate/view affected?
What is the CVSS score of CVE-2021-43808?
What CWE is associated with CVE-2021-43808?
How can I check Packagist dependencies for CVE-2021-43808?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-66hf-2p6w-jqfw",
"modified" : "2022-08-11T19:19:57Z",
"published" : "2021-12-08T19:57:36Z",
"aliases" : [ "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.\n\nGiven the following two Blade templates:\n\nresources/views/parent.blade.php:\n\n```html\n@section('content')\n<input value=\"{{ $value }}\">\n@show\n```\n\nresources/views/child.blade.php:\n\n```html\n@extends('parent')\n\n@section('content')\n<input value=\"{{ $value }}\">\n@endsection\n```\n\nAnd a route like the following:\n\n```php\nRoute::get('/example', function() {\n $value = '//localhost/###parent-placeholder-040f06fd774092478d450774f5ba30c5da78acc8## onclick=location.assign(this.value);//';\n\n return view('child', ['value' => $value]);\n});\n```\n\nThe 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.\n\nThis vulnerability has been patched by determining the parent placeholder at runtime and using a random hash that is unique to each request.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.20.42"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.30.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.75.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "illuminate/view"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.20.42"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "illuminate/view"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.30.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "illuminate/view"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.75.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/security/advisories/GHSA-66hf-2p6w-jqfw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43808"
}, {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/pull/39906"
}, {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/pull/39908"
}, {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/pull/39909"
}, {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/commit/b8174169b1807f36de1837751599e2828ceddb9b"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/illuminate/view/CVE-2021-43808.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/CVE-2021-43808.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/laravel/framework"
}, {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/releases/tag/v6.20.42"
}, {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/releases/tag/v7.30.6"
}, {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/releases/tag/v8.75.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-327", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-12-07T21:33:14Z",
"nvd_published_at" : "2021-12-08T00:15:00Z"
}
}