Miggo Logo

CVE-2022-24899: Cross site scripting via canonical tag in Contao

7.2

CVSS Score
3.1

Basic Information

EPSS Score
0.97879%
Published
5/20/2022
Updated
4/22/2024
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
contao/core-bundlecomposer>= 4.13.0, < 4.13.34.13.3
contao/contaocomposer>= 4.13.0, < 4.13.34.13.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t Untrust** us*rs **n inj**t m*li*ious *o** into t** **noni**l t**, w*i** is t**n *x**ut** on t** w** p*** (*ront *n*). ### P*t***s Up**t* to *ont*o *.**.*. ### Work*roun*s *is**l* **noni**l t**s in t** root p*** s*ttin*s. ### R***r*n*

Reasoning

T** vuln*r**ility st*ms *rom missin* output *n*o*in* w**n s*ttin* **noni**l URLs *n* m*t* ro*ots t**s in t** t*mpl*t*. T** *ommit *i** s*ows `*tmlsp**i*l***rs()` w*s ***** to *ot* `$*******->**tM*t*Ro*ots()` *n* `$*******->**t**noni**lUri*orR*qu*st()