Spring Security Advisories

CVE-2018-11040: JSONP enabled by default in MappingJackson2JsonView

MEDIUM | JUNE 14, 2018 | CVE-2018-11040

Description

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.

Affected Spring Products and Versions

  • Spring Framework 5.0 to 5.0.6
  • Spring Framework 4.1 to 4.3.17

Mitigation

Users of affected versions should apply the following mitigation:

  • 5.0.x users should upgrade to 5.0.7.
  • 4.3.x users should upgrade to 4.3.18.
  • Older versions should upgrade to a supported branch, or otherwise set MappingJacksonJsonView’s jsonpParameterNames property to an empty set.

Applications that do require JSONP support will need to explicitly configure the jsonpParameterNames property of MappingJacksonJsonView following the upgrade. It is recommended that applications switch to using CORS instead of JSONP to enable cross-domain requests. JSONP support in the Spring Framework is deprecated as of 5.0.7 and 4.3.18 and will be removed in 5.1.

Credit

This issue was identified and reported by Meyyalagan Chandrasekaran.

References

History

  • 2018-06-14: Initial vulnerability report published.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all