Improper Neutralization Affecting gg.jte:jte-runtime package, versions [,3.1.16)


Severity

Recommended
0.0
medium
0
10

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

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (18th 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 IDSNYK-JAVA-GGJTE-8622671
  • published14 Jan 2025
  • disclosed13 Jan 2025
  • creditJacob Peterson

Introduced: 13 Jan 2025

CVE-2025-23026  (opens in a new tab)
CWE-150  (opens in a new tab)

How to fix?

Upgrade gg.jte:jte-runtime to version 3.1.16 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization due to improper escaping of backticks and dollar signs in the javaScriptBlock and javaScriptAttribute methods. An attacker can execute arbitrary JavaScript code.

PoC

Use the Jte Gradle Plugin with the following code in src/jte/xss.jte:

@param String someMessage
<!DOCTYPE html>
<html lang="en">
<head>
    <title>XSS Test</title>
    <script>window.someVariable = `${someMessage}`;</script>
</head>
<body>
<h1>XSS Test</h1>
</body>
</html>

Use the following Java code to demonstrate the XSS vulnerability:

final StringOutput output = new StringOutput();
JtexssGenerated.render(new OwaspHtmlTemplateOutput(output), null, "` + alert(`xss`) + `");
renderHtml(output);

CVSS Scores

version 4.0
version 3.1