CVE-2025-23026: Jte Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-vh22-6c6h-rm8q
CVSS 6.1
CWE-150 CWE-79
Published
Advisory Summary

CVE-2025-23026 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences) affecting Jte libraries in the Maven ecosystem. The issue involves jte's html templates containing javascript template strings are subject to xss. Remediation is available by upgrading affected packages to version 3.1.16.

CVE-2025-23026 at a Glance

CVE Identifier CVE-2025-23026
GHSA Identifier GHSA-vh22-6c6h-rm8q
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences
Affected Product Jte
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-23026

To remediate this vulnerability, upgrade all affected Jte dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gg.jte:jte fixed: 3.1.16
<dependency>
    <groupId>gg.jte</groupId>
    <artifactId>jte</artifactId>
    <version>3.1.16</version>
</dependency>
gg.jte:jte-runtime fixed: 3.1.16
<dependency>
    <groupId>gg.jte</groupId>
    <artifactId>jte-runtime</artifactId>
    <version>3.1.16</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=gg.jte

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2025-23026, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=gg.jte

Analyze the terminal output to locate any version of Jte in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.16), your application is affected.

Note: The mvn dependency:tree -Dincludes=gg.jte command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences, where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component. In Jte, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Jte HTML templates with `script` tags or script attributes that include a Javascript template string (backticks) are subject to XSS. ### Details The `javaScriptBlock` and `javaScriptAttribute` methods in the `Escape` class ([source](https://github.com/casid/jte/blob/main/jte-runtime/src/main/java/gg/jte/html/escape/Escape.java#L43-L83)) do not escape backticks, which are used for Javascript [template strings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#description). Dollar signs in template strings should also be escaped as well to prevent undesired interpolation. ### PoC 1. Use the [Jte Gradle Plugin](https://jte.gg/gradle-plugin/) with the following code in `src/jte/xss.jte`: ```html @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> ``` 2. Use the following Java code to demonstrate the XSS vulnerability: ```java final StringOutput output = new StringOutput(); JtexssGenerated.render(new OwaspHtmlTemplateOutput(output), null, "` + alert(`xss`) + `"); renderHtml(output); ``` ### Impact 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.

CVE-2025-23026 Affected Jte Versions

2 component(s)
Fixed Versions:
3.1.16
Product / Package Ecosystem Affected Versions Fixed Version
gg.jte:jte
Maven
< 3.1.16
3.1.16
gg.jte:jte-runtime
Maven
< 3.1.16
3.1.16

References

Frequently Asked Questions

What is CVE-2025-23026?
CVE-2025-23026 is a security vulnerability in Jte involving jte's HTML templates containing Javascript template strings are subject to XSS under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences.
Which Jte versions are affected?
Affected versions include releases prior to 3.1.16 across affected packages: gg.jte:jte, gg.jte:jte-runtime.
What version fixes CVE-2025-23026?
Upgrading to 3.1.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jte affected?
Yes, gg.jte:jte is affected in releases prior to 3.1.16. Upgrade your dependency to 3.1.16 or later.
Is jte-runtime affected?
Yes, gg.jte:jte-runtime is affected in releases prior to 3.1.16. Upgrade your dependency to 3.1.16 or later.
What is the CVSS score of CVE-2025-23026?
CVE-2025-23026 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2025-23026?
CVE-2025-23026 is classified under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.).
How can I check Maven dependencies for CVE-2025-23026?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=gg.jte'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vh22-6c6h-rm8q",
  "modified" : "2025-01-13T21:49:25Z",
  "published" : "2025-01-13T16:57:59Z",
  "aliases" : [ "CVE-2025-23026" ],
  "summary" : "jte's HTML templates containing Javascript template strings are subject to XSS",
  "details" : "### Summary\nJte HTML templates with `script` tags or script attributes that include a Javascript template string (backticks) are subject to XSS.\n\n### Details\nThe `javaScriptBlock` and `javaScriptAttribute` methods in the `Escape` class ([source](https://github.com/casid/jte/blob/main/jte-runtime/src/main/java/gg/jte/html/escape/Escape.java#L43-L83)) do not escape backticks, which are used for Javascript [template strings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#description). Dollar signs in template strings should also be escaped as well to prevent undesired interpolation.\n\n### PoC\n1. Use the [Jte Gradle Plugin](https://jte.gg/gradle-plugin/) with the following code in `src/jte/xss.jte`:\n    ```html\n    @param String someMessage\n    <!DOCTYPE html>\n    <html lang=\"en\">\n    <head>\n        <title>XSS Test</title>\n        <script>window.someVariable = `${someMessage}`;</script>\n    </head>\n    <body>\n    <h1>XSS Test</h1>\n    </body>\n    </html>\n    ```\n2. Use the following Java code to demonstrate the XSS vulnerability:\n    ```java\n    final StringOutput output = new StringOutput();\n    JtexssGenerated.render(new OwaspHtmlTemplateOutput(output), null, \"` + alert(`xss`) + `\");\n    renderHtml(output);\n    ```\n\n### Impact\nHTML 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "gg.jte:jte"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.1.15"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "gg.jte:jte-runtime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.1.15"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/casid/jte/security/advisories/GHSA-vh22-6c6h-rm8q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-23026"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/casid/jte/commit/a6fb00d53c7b8dbb86de933215dbe1b9191a57f1"
  }, {
    "type" : "WEB",
    "url" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#description"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/casid/jte"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/casid/jte/blob/main/jte-runtime/src/main/java/gg/jte/html/escape/Escape.java#L43-L83"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-150", "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-01-13T16:57:59Z",
    "nvd_published_at" : "2025-01-13T20:15:30Z"
  }
}