PHPJabbers Business Directory Script v3.2 - Multiple Vulnerabilities
# Exploit Title: PHPJabbers Business Directory Script v3.2 - Multiple Vulnerabilities
# Date: 09/08/2023
# Exploit Author: Kerimcan Ozturk
# Vendor Homepage: https://www.phpjabbers.com/
# Software Link: https://www.phpjabbers.com/business-directory-script/
# Version: 3.2
# Tested on: Windows 10 Pro
## Description
Technical Detail / POC
==========================
Login Account
Go to Property Page (
https://website/index.php?controller=pjAdminListings&action=pjActionUpdate)
Edit Any Property (
https://website/index.php?controller=pjAdminListings&action=pjActionUpdate&id=57
)
[1] Cross-Site Scripting (XSS)
Request:
https://website/index.php?controller=pjAdminListings&action=pjActionUpdate&id=57&locale=1&tab_id=
"<script><image/src/onerror=prompt(8)>
[2] Cross-Site Request Forgery
Request:
https://website/index.php?controller=pjAdminListings&action=pjActionUpdate&id=57&locale=1&tab_id=
"<script><font%20color="green">Kerimcan%20Ozturk</font>
Best Regards PHPJabbers Business Directory Script v3.2: A Deep Dive into Critical Security Vulnerabilities
PHPJabbers Business Directory Script v3.2, a widely used open-source platform for managing business listings, has recently been flagged for multiple security flaws that pose significant risks to both administrators and end users. Identified by cybersecurity researcher Kerimcan Ozturk on August 9, 2023, these vulnerabilities highlight the dangers of insufficient input validation and inadequate protection against common web attack vectors.
Overview of the Vulnerable System
PHPJabbers Business Directory Script v3.2 is designed to allow businesses to register, manage, and display their services or products through a centralized web interface. It supports multi-language localization, user authentication, and administrative controls. While the script is marketed as a "ready-to-use" solution, its implementation exposes critical weaknesses in security architecture, especially in its handling of user input and session management.
The core vulnerability lies in the admin listing update functionality, accessible via:
https://website/index.php?controller=pjAdminListings&action=pjActionUpdate&id=57This endpoint allows administrators to edit business listings, but it fails to sanitize user-provided data before rendering it on the frontend. As a result, attackers can inject malicious scripts or manipulate requests through crafted parameters.
1. Cross-Site Scripting (XSS) – A Persistent Threat
One of the most critical vulnerabilities in this version is Reflected Cross-Site Scripting (XSS). This occurs when user input is directly reflected in the web page without proper sanitization.
Attackers can exploit the tab_id parameter to inject malicious JavaScript code. For example:
https://website/index.php?controller=pjAdminListings&action=pjActionUpdate&id=57&locale=1&tab_id=%22%3Cscript%3E%3Cimage%2Fsrc%2Fonerror%3Dprompt%288%29%3E%3C%2Fscript%3EHere, the tab_id parameter is set to a malicious payload that embeds a script tag. When the page renders, the browser executes the script due to the onerror attribute on an invalid image source.
Impact: An authenticated user (admin or regular user) visiting the page may trigger a alert() dialog with the number 8, which serves as a proof-of-concept. In real-world scenarios, attackers could steal session cookies, redirect users to phishing sites, or perform actions on behalf of the victim.
Why this happens: The script fails to validate or escape special characters like <, >, and ; in user-supplied input. The absence of htmlspecialchars() or similar sanitization functions in the rendering logic is a clear security oversight.
2. Cross-Site Request Forgery (CSRF) – Exploiting Trust
Another critical flaw is the lack of CSRF protection in the admin update workflow. CSRF attacks exploit the trust that a website has in a user’s authenticated session to perform unauthorized actions.
As demonstrated in the exploit, a malicious actor can craft a request that appears legitimate:
https://website/index.php?controller=pjAdminListings&action=pjActionUpdate&id=57&locale=1&tab_id=%22%3Cscript%3E%3Cfont%20color%3D%22green%22%3EKerimcan%20Ozturk%3C%2Ffont%3E%3C%2Fscript%3EWhile this example is primarily a proof-of-concept XSS, it also illustrates how CSRF can be combined with XSS to amplify damage. If the admin is tricked into visiting a malicious link, their session can be hijacked or their listing altered without consent.
Security Implication: Without CSRF tokens or session validation checks, the system assumes every request from an authenticated user is legitimate. This trust is exploited by attackers who can embed malicious URLs in emails, social media posts, or even within the admin dashboard itself.
Security Best Practices & Fixes
To mitigate these vulnerabilities, developers and administrators must implement the following security measures:
- Input Sanitization: Always sanitize user input using functions like
htmlspecialchars()orfilter_input()before rendering. - CSRF Tokens: Generate and validate unique tokens for every administrative action. Tokens should be tied to the session and invalidated after use.
- Output Encoding: Use proper encoding (e.g., HTML entity encoding) when displaying dynamic content.
- Parameter Validation: Restrict allowed values for parameters like
tab_idandlocaleusing whitelisting.
Here is a corrected code snippet for input handling:
// Example of safe input handling in PHP
$tab_id = filter_input(INPUT_GET, 'tab_id', FILTER_SANITIZE_STRING);
if (empty($tab_id)) {
$tab_id = '';
}
echo htmlspecialchars($tab_id, ENT_QUOTES, 'UTF-8');Explanation: This code uses filter_input() to sanitize the tab_id parameter, then applies htmlspecialchars() to prevent script injection. This ensures that any special characters are rendered as plain text, not executable code.
Recommendations for Users and Developers
| Recommendation | Impact |
|---|---|
| Update to the latest version | Eliminates known vulnerabilities |
| Implement CSRF protection | Prevents unauthorized actions |
| Use a Web Application Firewall (WAF) | Blocks malicious requests in real time |
| Conduct regular penetration testing | Identifies hidden flaws before exploitation |
For administrators using PHPJabbers Business Directory Script v3.2, immediate action is required. The current version is not safe for production environments without additional security hardening.
Conclusion
PHPJabbers Business Directory Script v3.2 serves as a cautionary tale in web security. Even seemingly simple features—like editing business listings—can become attack vectors if input handling is not rigorously enforced. The combination of XSS and CSRF vulnerabilities underscores the importance of defense-in-depth strategies.
As cybersecurity professionals, we must advocate for secure-by-design principles: validate, sanitize, and verify every input. The cost of neglecting these practices can be devastating—data breaches, reputational damage, and legal liability.