CVE-2026-41845

Spring Framework Cross-site Scripting via JavaScriptUtils

Published Jun 9, 2026 CVSS 3.1 · 7.1 High EPSS < 1% KEV · Not listed
Description
Due to incorrect escaping, the use of JavaScriptUtils.javaScriptEscape() may lead to JavaScript code injection in the browser, potentially resulting in a cross-site scripting (XSS) vulnerability.

Affected versions:
Spring Framework 7.0.0 through 7.0.7; 6.2.0 through 6.2.18; 6.1.0 through 6.1.27; 5.3.0 through 5.3.48.

Analysis

AI-generated

Technical impact

The Spring Framework’s JavaScriptUtils.javaScriptEscape method fails to properly escape characters that can break out of a JavaScript context, allowing an attacker to inject arbitrary JavaScript when the escaped string is rendered in a browser. This flaw can be leveraged to execute malicious scripts in the victim’s browser, compromising confidentiality or integrity of the user’s session data, or facilitating further phishing or credential theft. The underlying weakness is an input validation error, identified as CWE‑79, leading to a classic reflected XSS scenario where untrusted data is included in client‑side output without appropriate sanitization.

Affected Systems

Applications built on Spring Framework versions 7.0.0‑7.0.7, 6.2.0‑6.2.18, 6.1.0‑6.1.27, and 5.3.0‑5.3.48 are vulnerable. This includes any projects that depend on these releases of the framework and utilize JavaScriptUtils for escaping strings in views or other client‑side outputs.

Risk and Exploitability

The CVSS score of 7.1 indicates a high severity level, and while the EPSS score is not available, the fact that a standard browser context is required for exploitation suggests that this vulnerability could be widely used by attackers who can persuade users to visit a malicious link or embed the payload in a web page. It is not currently listed in the CISA KEV catalog, but the presence of a client‑side flaw with no authentication or privilege checks means that any user of the affected application is a potential victim. Exploitation requires only that the vulnerable method is called with attacker‑controlled data that is subsequently sent to the browser; no additional credentials are needed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Spring Framework release that includes the XSS fix (7.0.8 or later, 6.2.19 or later, 6.1.28 or later, 5.3.49 or later).
  • If an immediate upgrade is not possible, remove or replace all uses of JavaScriptUtils.javaScriptEscape in application code, ensuring that all JavaScript content is either omitted or properly encoded by a trusted utility before rendering.
  • Implement additional client‑side defense mechanisms, such as Content Security Policy headers, to limit the execution scope of any accidentally injected scripts, and validate all inputs server‑side to prevent injection of malicious data into the rendering context.

Generated by OpenCVE AI on June 9, 2026 at 05:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-3chg-m5w7-qfv5 Spring Framework Cross-site Scripting via JavaScriptUtils
References
History
Type Values Removed Values Added
First Time appeared Vmware
Vmware spring Framework
CPEs cpe:2.3:a:vmware:spring_framework:*:*:*:*:*:*:*:*
Vendors & Products Vmware
Vmware spring Framework
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Spring
Spring spring Framework
Vendors & Products Spring
Spring spring Framework
Type Values Removed Values Added
Description Due to incorrect escaping, the use of JavaScriptUtils.javaScriptEscape() may lead to JavaScript code injection in the browser, potentially resulting in a cross-site scripting (XSS) vulnerability. Affected versions: Spring Framework 7.0.0 through 7.0.7; 6.2.0 through 6.2.18; 6.1.0 through 6.1.27; 5.3.0 through 5.3.48.
Title Spring Framework Cross-site Scripting via JavaScriptUtils
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
vmware
Published
Updated
Jun 27, 2026, 9:01 PM
Reserved
Apr 22, 2026, 6:22 AM
Status
Analyzed
Published
Jun 9, 2026, 5:16 AM
Modified
Jul 23, 2026, 8:10 AM