Skip to main content

CVE-2024-0504: Simple Hotel Reservation System XSS Flaw

CVE-2024-0504 is a cross-site scripting vulnerability in Simple Online Hotel Reservation System that allows attackers to inject malicious scripts. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-0504 Overview

CVE-2024-0504 is a reflected cross-site scripting (XSS) vulnerability in code-projects Simple Online Hotel Reservation System 1.0. The flaw resides in the add_reserve.php script that powers the Make a Reservation page. Attackers can inject arbitrary JavaScript through the Firstname and Lastname parameters because the application fails to sanitize user input before rendering it in the response. The issue is tracked under identifier VDB-250618 and categorized under CWE-79. The exploit details have been publicly disclosed, increasing the likelihood of opportunistic abuse against exposed deployments.

Critical Impact

Remote attackers can execute arbitrary JavaScript in a victim's browser session, enabling session hijacking, credential theft, and page defacement without authentication.

Affected Products

  • Fabian / code-projects Simple Online Hotel Reservation System 1.0
  • add_reserve.php component (Make a Reservation Page)
  • Deployments exposing the reservation form to untrusted users

Discovery Timeline

  • 2024-01-13 - CVE-2024-0504 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-0504

Vulnerability Analysis

The vulnerability is a reflected cross-site scripting (XSS) issue classified under [CWE-79]. The add_reserve.php endpoint accepts reservation data from an HTTP request and echoes the submitted Firstname and Lastname values back to the client without output encoding. An attacker crafts a URL or form submission containing JavaScript payloads such as <script>alert(1)</script> in either field. When the victim loads the resulting page, the browser parses the injected markup and executes attacker-controlled script in the application's origin.

Exploitation requires user interaction, typically through a phishing link that triggers the reservation request. Because the attack crosses the trust boundary of the hosting page, injected scripts can read cookies, access the DOM, and submit authenticated requests on behalf of the victim.

Root Cause

The root cause is missing input validation and output encoding in add_reserve.php. The application concatenates request parameters directly into the HTML response. There is no HTML entity encoding, no allow-list filtering, and no Content Security Policy to constrain inline script execution.

Attack Vector

The attack vector is network-based and requires no privileges. An attacker delivers a crafted link to the Make a Reservation page with malicious Firstname or Lastname values. When the victim visits the link, the server reflects the payload into the response and the browser executes it. Payloads can steal session identifiers, pivot to CSRF against administrative endpoints, or redirect users to credential harvesting pages.

No verified proof-of-concept code is published beyond the disclosure. See the VulDB entry #250618 for the public write-up.

Detection Methods for CVE-2024-0504

Indicators of Compromise

  • Web server access logs containing add_reserve.php requests with angle brackets, <script>, onerror=, or URL-encoded equivalents (%3Cscript%3E) in the Firstname or Lastname parameters
  • Unexpected outbound requests from client browsers to attacker-controlled domains shortly after visiting the reservation page
  • Browser console errors or Content Security Policy violation reports originating from the reservation workflow

Detection Strategies

  • Deploy web application firewall (WAF) signatures that flag common XSS payload patterns submitted to add_reserve.php
  • Correlate HTTP request logs with user-agent strings and referrers to identify phishing-driven exploitation attempts
  • Perform static analysis of PHP source to confirm whether htmlspecialchars() or equivalent encoding is applied before echoing request data

Monitoring Recommendations

  • Enable verbose logging of all POST and GET parameters on reservation endpoints and ship logs to a centralized analytics platform
  • Alert on repeated 200-response requests containing script tag characters in form fields
  • Monitor for anomalous session activity, including concurrent sessions from distinct geographies, that may indicate stolen cookies

How to Mitigate CVE-2024-0504

Immediate Actions Required

  • Restrict public access to the Simple Online Hotel Reservation System until output encoding is implemented in add_reserve.php
  • Apply a WAF rule set that blocks XSS payload patterns on all reservation form fields
  • Rotate active session cookies and force re-authentication for any user who submitted reservations during the exposure window

Patch Information

No vendor patch is listed in the NVD advisory or associated references for CVE-2024-0504. Administrators should contact the project maintainer or apply source-level fixes that enforce HTML entity encoding on all user-supplied data before rendering. Review the VulDB CTI entry for current disclosure status.

Workarounds

  • Modify add_reserve.php to wrap Firstname and Lastname output in htmlspecialchars($value, ENT_QUOTES, 'UTF-8') before echoing to the response
  • Deploy a strict Content Security Policy that disallows inline scripts and restricts script sources to trusted origins
  • Add server-side input validation that rejects reservation submissions containing HTML control characters such as <, >, and "
  • Place the application behind an authenticated reverse proxy or internal network segment if public exposure is not required
bash
# Example Content Security Policy header to reduce XSS impact
Header set Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.