CVE-2025-23026 HTML templates containing Javascript template strings are subject to XSS in jte

Medium 6.1 Published Updated

Attackers can execute arbitrary JavaScript via unescaped backticks in HTML templates, affecting Java and Kotlin applications using the jte library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-23026?

CVE-2025-23026 is a medium-severity cross-site scripting vulnerability in casid jte, published on 13 Jan 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

jte (Java Template Engine) is a secure and lightweight template engine for Java and Kotlin. In affected versions Jte HTML templates with `script` tags or script attributes that include a Javascript template string (backticks) are subject to XSS. The `javaScriptBlock` and `javaScriptAttribute` methods in the `Escape` class do not escape backticks, which are used for Javascript template strings. Dollar signs in template strings should also be escaped as well to prevent undesired interpolation. HTML templates rendered by Jte's `OwaspHtmlTemplateOutput` in versions less than or equal to `3.1.15` with `script` tags or script attributes that contain Javascript template strings (backticks) are vulnerable. Users are advised to upgrade to version 3.1.16 or later to resolve this issue. There are no known workarounds for this vulnerability.

Weakness: CWE-79, CWE-150

Which versions are affected by CVE-2025-23026?

4 open source packages ship an affected version, including gg.jte:jte and gg.jte:jte-runtime.

PackageAffectedFixed in
gg.jte:jte MavenAll versions3.1.16
gg.jte:jte MavenAll versions3.1.16
gg.jte:jte-runtime MavenAll versions3.1.16
gg.jte:jte-runtime MavenAll versions3.1.16

How do I fix CVE-2025-23026?

Upgrade gg.jte:jte to 3.1.16 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-23026 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-23026 exists.

Sources

Also known as GHSA-vh22-6c6h-rm8q.

Is CVE-2025-23026 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free