CVE-2024-43407
Executive Summary
CVE-2024-43407 is a reflected Cross-Site Scripting (XSS) vulnerability in the CKEditor 4 Code Snippet GeSHi plugin. The flaw resides in the outdated GeSHi syntax highlighter library, which is included as a vendor dependency. An attacker can craft a malicious script that executes when a victim sends a request to the GeSHi library hosted on a PHP web server. The GeSHi library is no longer maintained, making this a supply chain risk. The CKEditor team has removed the GeSHi dependency entirely in version 4.25.0-lts to mitigate the issue. The CVSS score is 6.1 (Medium), and no public exploit code or PoC is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability originates from an unmaintained third-party library (GeSHi) bundled with CKEditor 4. The GeSHi library is a PHP-based syntax highlighter that has not received updates, leading to potential security flaws. The CKEditor team has addressed this by removing the dependency entirely, shifting to a more secure alternative. Organizations using CKEditor 4 should verify they are not relying on the GeSHi plugin and upgrade to the latest LTS version to eliminate this supply chain risk.
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a crafted link or visit a malicious page)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
- Threat Level: Medium – Exploitation requires user interaction, but the attack surface is broad due to the widespread use of CKEditor.
Deep Dive & Mechanics
The vulnerability exists in the GeSHi library, which is used by CKEditor 4's Code Snippet plugin to highlight code syntax. The GeSHi library is a PHP script that processes requests and returns highlighted HTML. A reflected XSS occurs when user input is not properly sanitized and is reflected back in the response. In this case, an attacker can craft a URL that, when visited by a victim, causes the GeSHi library to execute arbitrary JavaScript in the victim's browser. The attack flow:
- The attacker identifies a CKEditor 4 instance using the Code Snippet GeSHi plugin.
- The attacker crafts a malicious URL that includes a payload in a parameter (e.g.,
?language=javascript&code=<script>alert(1)</script>). - The victim clicks the link or is redirected to it.
- The GeSHi library processes the request and reflects the malicious script in the response without proper encoding.
- The victim's browser executes the script, leading to session theft, defacement, or other malicious actions.
The root cause is the lack of output encoding in the GeSHi library, combined with its unmaintained status. The CKEditor team's fix removes the dependency entirely, eliminating the attack vector.
Vulnerable vs. Patched Code
Vulnerable (GeSHi library):
// Example of vulnerable GeSHi code (simplified)
$code = $_GET['code'];
echo "<pre class=\"brush: $language\">$code</pre>";
The $code variable is directly echoed without sanitization, allowing script injection.
Patched (CKEditor 4.25.0-lts): The GeSHi library is completely removed. CKEditor now uses a different syntax highlighting mechanism (e.g., Prism.js or highlight.js) that is actively maintained and properly sanitizes input. No code snippet is provided as the fix is a removal of the vulnerable component.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A CKEditor 4 instance with the Code Snippet GeSHi plugin enabled (version < 4.25.0-lts).
- A PHP web server hosting the GeSHi library (typically
geshi.php).
Exploitation Steps:
- Identify the vulnerable endpoint:
http://target.com/ckeditor/plugins/codesnippet/lib/geshi/geshi.php - Craft a malicious URL with a JavaScript payload:
http://target.com/ckeditor/plugins/codesnippet/lib/geshi/geshi.php?language=javascript&code=<script>alert('XSS')</script> - Send the link to the victim via phishing email or social engineering.
- When the victim clicks the link, the script executes in their browser.
Note: No public exploit code is available. The above is a conceptual example.
Blue Team
Detection:
- Monitor web server logs for requests to
/ckeditor/plugins/codesnippet/lib/geshi/geshi.phpwith suspicious parameters (e.g.,code=<script>). - Use WAF rules to block requests containing
<script>tags in query parameters. - Implement CSP headers to mitigate XSS impact.
Hunting:
- Search for any instances of the GeSHi library in your web applications.
- Verify that CKEditor is updated to version 4.25.0-lts or later.
Indicators of Compromise (IOCs)
- File Path:
/ckeditor/plugins/codesnippet/lib/geshi/geshi.php - URL Pattern:
?language=*&code=*with script tags in thecodeparameter. - Network Traffic: HTTP requests to the GeSHi endpoint with unusual query strings.
- Log Entries:
GET /ckeditor/plugins/codesnippet/lib/geshi/geshi.php?language=javascript&code=<script>alert(1)</script>
Detection Engineering
YARA Rule
rule CVE_2024_43407_GeSHi_XSS {
meta:
description = "Detects requests to vulnerable GeSHi library with potential XSS payload"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-43407"
strings:
$geshi_path = "/ckeditor/plugins/codesnippet/lib/geshi/geshi.php"
$xss_payload = /code=<script>/
condition:
$geshi_path and $xss_payload
}
Sigma Rule
title: CVE-2024-43407 Reflected XSS in CKEditor GeSHi Plugin
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests to the vulnerable GeSHi library with script tags in the code parameter
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/ckeditor/plugins/codesnippet/lib/geshi/geshi.php'
cs-uri-query|contains: 'code=<script>'
condition: selection
falsepositives:
- Legitimate use of GeSHi with code snippets (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-43407 CKEditor GeSHi Reflected XSS"; flow:to_server,established; content:"GET"; http_method; content:"/ckeditor/plugins/codesnippet/lib/geshi/geshi.php"; http_uri; content:"code=<script>"; http_uri; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade CKEditor 4 to version 4.25.0-lts or later. This removes the GeSHi dependency entirely.
- Workaround: If upgrade is not possible, manually remove the GeSHi library from the CKEditor installation:
- Delete the folder
ckeditor/plugins/codesnippet/lib/geshi/ - Disable the Code Snippet plugin in CKEditor configuration.
- Delete the folder
- Long-term: Migrate to CKEditor 5, which does not include the GeSHi library and has a more modern architecture.
- Monitoring: Implement WAF rules to block requests containing script tags in query parameters.
- Training: Educate users about phishing attacks that may exploit this vulnerability.
Valters IT – Securing your digital frontier.