CVE-2023-4771:
CKEditor cross-site scripting vulnerability in AJAX sample
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.95167%
CWE
Published
2/7/2024
Updated
2/7/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
ckeditor4 | npm | < 4.24.0-lts | 4.24.0-lts |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the AJAX sample's insecure handling of editor content. The original code in samples/old/ajax.html
used document.getElementById('editorcontents').innerHTML = editor.getData()
, which directly injected raw HTML without sanitization. This allowed execution of arbitrary JavaScript if the content contained malicious scripts. The patch replaced innerHTML
with .value
on a textarea, which neutralizes the XSS risk. The vulnerable function is saveData()
, which implemented the unsafe innerHTML
assignment. The core CKEditor functions (e.g., getData()
) are not inherently vulnerable, but the sample's misuse of the API introduced the XSS vector.