漏洞描述
- JSONP enabled by default in MappingJackson2JsonView。
漏洞介绍
- Spring Framework, versions 5.0.x prior to 5.0.7, versions 4.3.x prior to 4.3.18, and older unsupported versions, allows web applications to enable cross-domain requests via JSONP (JSON with Padding) through AbstractJsonpResponseBodyAdvice for REST controllers, and MappingJackson2JsonView for browser requests. Both are not enabled by default in Spring Framework nor Spring Boot. However when MappingJackson2JsonView is configured in an application, JSONP support is automatically ready to use through the “jsonp” and “callback” JSONP parameters, enabling cross-domain requests.
Allowing cross-domain requests from untrusted origins may expose user information to 3rd party browser scripts.
This vulnerability applies to applications that:
Explicitly configure MappingJackson2JsonView.
And do not set the jsonpParameterNames property of MappingJackson2JsonView to an empty set.
And expose sensitive user information over endpoints that can render content with JSONP.