Описание
Spring MVC and WebFlux applications that obtain a data-binding Errors instance with HTML escaping enabled and then render field errors using the no-argument Errors.getFieldErrors() or Errors.getFieldError() accessors are vulnerable to arbitrary HTML/JavaScript code injection, potentially resulting in a reflected cross-site scripting (XSS) vulnerability.
Spring Framework 7.0.0 - 7.0.8
Spring Framework 6.2.0 - 6.2.19
Spring Framework 6.1.0 - 6.1.28
Spring Framework 6.0.0 - 6.0.30
Spring Framework 5.3.0 - 5.3.49
Spring Framework 5.2.25.RELEASE and earlier
A flaw was found in Spring MVC and WebFlux applications. When these applications are configured to obtain a data-binding Errors instance with HTML escaping enabled and then render field errors using the no-argument Errors.getFieldErrors() or Errors.getFieldError() accessors, they become vulnerable. This vulnerability allows for arbitrary HTML or JavaScript code injection, potentially leading to a reflected cross-site scripting (XSS) attack where an attacker could execute malicious scripts in a user's web browser.
Отчет
A cross-site scripting (XSS) vulnerability was found in the Spring Framework EscapedErrors wrapper. In versions 7.0.0 through 7.0.8, 6.2.0 through 6.2.19, 6.1.0 through 6.1.28, 6.0.0 through 6.0.30, 5.3.0 through 5.3.49, and 5.2.25.RELEASE and earlier, Spring MVC and WebFlux applications that obtain a data-binding Errors instance with HTML escaping enabled and then render field errors using the no-argument Errors.getFieldErrors() or Errors.getFieldError() accessors are vulnerable to arbitrary HTML and JavaScript code injection. The EscapedErrors wrapper's no argument accessors return the underlying field errors without escaping them, allowing attackers to inject malicious content that executes when the page is rendered, potentially resulting in reflected cross-site scripting attacks. This vulnerability was introduced in 2006 with Spring Framework 2.0. Red Hat ships Spring Framework version 2.x in Fedora, a community-supported distribution, which is affected by this vulnerability but is out of Red Hat's commercial support scope.
Меры по смягчению последствий
Red Hat does not provide fixes for Spring Framework in Fedora, as it is a community-supported product outside of Red Hat's commercial support scope. Fedora users should monitor upstream Spring Framework releases and community package updates. For customers using Spring Framework in custom applications or third-party software, the following mitigations are available:
- Upgrade to Spring Framework 7.0.9 or later if using the 7.0.x line. Note that Spring Framework versions 4.3.x, 5.3.x, 6.1.x, and 6.2.x have reached end-of-life and will not receive public security updates.
- If immediate upgrade is not possible, reduce exposure by rendering field errors through the per-field getFieldErrors(String field) and getFieldError(String field) accessors, or through getAllErrors(), which are escaped correctly.
- Alternatively, explicitly HTML-escape the rejectedValue and defaultMessage of each field error in the template rather than relying on the wrapper to perform escaping.
- Implement Content Security Policy (CSP) headers to provide an additional layer of defense against XSS attacks.
- Review application code to identify uses of the no-argument Errors.getFieldErrors() or Errors.getFieldError() methods and replace them with the safer per-field accessors.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Red Hat build of Apache Camel - HawtIO 4 | spring-webmvc | Fix deferred | ||
| Red Hat Enterprise Linux 8 | pki-core:10.6/resteasy | Fix deferred | ||
| Red Hat Enterprise Linux 8 | pki-deps:10.6/resteasy | Fix deferred | ||
| Red Hat Enterprise Linux 9 | resteasy | Fix deferred | ||
| Red Hat Fuse 7 | spring-webflux | Out of support scope | ||
| Red Hat Fuse 7 | spring-webmvc | Out of support scope | ||
| Red Hat OpenShift Dev Spaces | devspaces/openvsx-rhel9 | Fix deferred | ||
| Red Hat OpenShift Dev Spaces | devspaces/pluginregistry-rhel9 | Fix deferred | ||
| Red Hat Single Sign-On 7 | spring-webmvc | Out of support scope |
Показывать по
Дополнительная информация
Статус:
EPSS
5.4 Medium
CVSS3
Связанные уязвимости
Spring MVC and WebFlux applications that obtain a data-binding Errors instance with HTML escaping enabled and then render field errors using the no-argument Errors.getFieldErrors() or Errors.getFieldError() accessors are vulnerable to arbitrary HTML/JavaScript code injection, potentially resulting in a reflected cross-site scripting (XSS) vulnerability. Spring Framework 7.0.0 - 7.0.8 Spring Framework 6.2.0 - 6.2.19 Spring Framework 6.1.0 - 6.1.28 Spring Framework 6.0.0 - 6.0.30 Spring Framework 5.3.0 - 5.3.49 Spring Framework 5.2.25.RELEASE and earlier
Spring MVC and WebFlux applications that obtain a data-binding Errors instance with HTML escaping enabled and then render field errors using the no-argument Errors.getFieldErrors() or Errors.getFieldError() accessors are vulnerable to arbitrary HTML/JavaScript code injection, potentially resulting in a reflected cross-site scripting (XSS) vulnerability. Spring Framework 7.0.0 - 7.0.8 Spring Framework 6.2.0 - 6.2.19 Spring Framework 6.1.0 - 6.1.28 Spring Framework 6.0.0 - 6.0.30 Spring Framework 5.3.0 - 5.3.49 Spring Framework 5.2.25.RELEASE and earlier
Spring MVC and WebFlux applications that obtain a data-binding Errors ...
Spring MVC and WebFlux applications that obtain a data-binding Errors instance with HTML escaping enabled and then render field errors using the no-argument Errors.getFieldErrors() or Errors.getFieldError() accessors are vulnerable to arbitrary HTML/JavaScript code injection, potentially resulting in a reflected cross-site scripting (XSS) vulnerability. Spring Framework 7.0.0 - 7.0.8 Spring Framework 6.2.0 - 6.2.19 Spring Framework 6.1.0 - 6.1.28 Spring Framework 6.0.0 - 6.0.30 Spring Framework 5.3.0 - 5.3.49 Spring Framework 5.2.25.RELEASE and earlier
EPSS
5.4 Medium
CVSS3