CVE-2024-47765
PHP vulnerability analysis and mitigation

Overview

Minecraft MOTD Parser, a PHP library for parsing Minecraft server MOTD (Message of the Day), contains a cross-site scripting (XSS) vulnerability identified as CVE-2024-47765. The vulnerability was discovered in versions up to 1.0.5 and has been fixed in version 1.0.6. The HtmlGenerator class is susceptible to XSS attacks through malformed Minecraft server MOTD parsing, where an attacker can inject malicious HTML into web pages during generation (GitHub Advisory).

Technical details

The vulnerability exists in the HtmlGenerator class which iterates through MotdItem objects contained in a MotdItemCollection to generate HTML strings. The core issue stems from insufficient validation and escaping of user input in the color and text properties of MotdItem objects. When processing these properties, the values are directly inserted into the HTML output without proper sanitization, allowing attackers to inject arbitrary HTML and JavaScript code. The vulnerability has been assigned a CVSS v4.0 base score of 6.9 (Medium) with vector string CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N (NVD).

Impact

The vulnerability can affect multiple scenarios including players visiting Minecraft server list websites that display MOTDs, users accessing Minecraft server status websites, and server owners managing their Minecraft servers via web interfaces that display MOTDs. Attackers can exploit this vulnerability by sending malicious MOTDs from Minecraft servers under their control, potentially executing arbitrary JavaScript code in users' browsers (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 1.0.6 by implementing proper HTML escaping for the color and text properties. The fix includes converting all HTML special characters to HTML entities using the htmlentities() function with ENTQUOTES and ENTHTML5 flags. Users are strongly advised to upgrade to version 1.0.6 or later (GitHub Patch).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management