CVE-2022-24899: Cross site scripting via canonical tag in Contao
7.2
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.97879%
CWE
Published
5/20/2022
Updated
4/22/2024
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| contao/core-bundle | composer | >= 4.13.0, < 4.13.3 | 4.13.3 |
| contao/contao | composer | >= 4.13.0, < 4.13.3 | 4.13.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from missing output encoding when setting canonical URLs and meta robots tags in the template. The commit diff shows htmlspecialchars() was added to both $headBag->getMetaRobots() and $headBag->getCanonicalUriForRequest() in PageRegular.php's prepare() method. This indicates these values were previously injected into the template without proper escaping, making the prepare() method's handling of these values the vulnerable point. While the HeadBag methods provide the data, the root cause is the lack of escaping at the template assignment layer in PageRegular::prepare.