CVE-2022-0970: Stored Cross-site Scripting in grav
7.1
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.54749%
CWE
Published
3/16/2022
Updated
1/27/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
getgrav/grav | composer | < 1.7.31 | 1.7.31 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from two key gaps: 1) The file upload handler (MediaUploadTrait) lacked XSS checks for SVG files before storage, and 2) The XSS detection regex in Security::detectXss
had a pattern matching flaw. The patch added both the XSS check invocation in the upload workflow (via FormFlashFile::checkXss
) and fixed the entity sanitization regex (!(&#[0-9]+);?!u), confirming these were the vulnerable points.