CVE-2022-25037: wangEditor was discovered to contain a cross-site scripting (XSS) vulnerability via the image upload function
N/A
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
0.36929%
CWE
-
Published
5/31/2024
Updated
6/4/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
-
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| @wangeditor/editor | npm | <= 4.7.11 | 4.7.12 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from unsanitized user input in image upload handling. The commit diff shows the patched version added HTML entity encoding for src/alt attributes and replaced dangerous string concatenation with DOM property setting. The original vulnerable code in upload-img.ts directly interpolated user-controlled values (src, alt, href) into HTML strings without escaping, enabling XSS payloads like "><img src=1 onerror=alert(1)>. Test cases in upload-img.test.ts confirm XSS scenarios were possible through image URL and alt text inputs. This matches the CVE description of image upload XSS and the GHSA advisory.