Open-Source Security Intelligence

Know every vulnerability
before it knows you.

DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.

Search

GHSA-vh22-6c6h-rm8q

MediumCVSS 6.1 / 10
Published Jan 13, 2025·Last modified Jan 13, 2025
Affected Components(0)

No affected components available

Description

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

PoC

  1. 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>
    
  2. 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);
    

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.

Risk Scores
Base Score
6.1

The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. The attacker needs the user to perform some action, like clicking a link. The vulnerability can affect other systems as well, not just the initial system. There is a low impact on the confidentiality of the information. There is a low impact on the integrity of the data.

Threat Intelligence
5.6

Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.

EPSS
0.29%

The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.

Exploit
Not available

We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.

Browse More

Scan your project

Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.

Checkout DevGuard