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

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

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **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:** Yes
- **Published:** 13 Jan 2025
- **Updated:** 13 Jan 2025
- **Also known as:** GHSA-vh22-6c6h-rm8q

## 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 (Improper Neutralization of Input During Web Page Generation), CWE-150 (Improper Neutralization of Escape, Meta, or Control Sequences)

## 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.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gg.jte:jte` | Maven | All versions | 3.1.16 |
| `gg.jte:jte` | Maven | All versions | 3.1.16 |
| `gg.jte:jte-runtime` | Maven | All versions | 3.1.16 |
| `gg.jte:jte-runtime` | Maven | All versions | 3.1.16 |

## How do I fix CVE-2025-23026?

Upgrade gg.jte:jte to 3.1.16 or later.

## Is CVE-2025-23026 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-23026 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-23026 exists.

Affected packages and fixed versions:
- gg.jte:jte (Maven): affected all versions; fixed in 3.1.16
- gg.jte:jte (Maven): affected all versions; fixed in 3.1.16
- gg.jte:jte-runtime (Maven): affected all versions; fixed in 3.1.16
- gg.jte:jte-runtime (Maven): affected all versions; fixed in 3.1.16

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-23026/ (Markdown: https://insights.sbomify.com/CVE-2025-23026/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-23026
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-23026
- OSV: https://osv.dev/vulnerability/CVE-2025-23026

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-23026/
Summaries are generated and may contain mistakes; the official description above is the record.
