CVE-2021-41749: Code Injection in SEOmatic
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.99318%
CWE
Published
6/13/2022
Updated
1/27/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| nystudio107/craft-seomatic | composer | < 3.4.11 | 3.4.11 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from the order of operations in URL sanitization. The original implementation in safeCanonicalUrl() sanitized the URL before making it absolute via UrlHelper::absoluteUrlWithProtocol(), which could incorporate untrusted X-Forwarded-Host header values. By moving the sanitization step after the absolute URL generation in the patch, the developers confirmed that the vulnerability existed in how these two functions were ordered. The safeCanonicalUrl() method is the direct entry point for this attack vector as it handles canonical URL generation exposed to unauthenticated users.