The vulnerability (CVE-2025-49585) in XWiki allows for privilege escalation due to insufficient rights validation for XClass definitions. Attackers with edit rights, but lacking script/programming rights, could create XClass properties containing malicious code (in custom displays, computed field scripts, or DB list queries). When a user with script, admin, or programming rights subsequently edits the document containing these XClasses, the embedded malicious code would execute with the editor's higher privileges. This was possible because XWiki did not previously analyze these specific XClass property contents for dangerous code requiring special rights.
The patch (commit 385bde985cdb61ebf315d30c0b144b6d2e2c2d45) rectifies this by introducing several new analyzer classes (PropertyClassRequiredRightAnalyzer, ComputedFieldClassRequiredRightAnalyzer, DBListClassRequiredRightAnalyzer, etc.) specifically designed to inspect the content retrieved by methods like getCustomDisplay(), getScript(), and getSql() from PropertyClass, ComputedFieldClass, and DBListClass respectively. These getter methods are identified as 'vulnerable' in the context of this CVE because they are the entry points for the malicious, unvalidated input into the system. During exploitation, these methods would supply the harmful data that is then processed by XWiki's rendering, scripting, or query execution mechanisms under the privileged user's context. The patch ensures that this data is now analyzed before such processing occurs, thus mitigating the risk.