Spring Security versions 4.2.x prior to 4.2.12, 5.0.x prior to 5.0.12, and 5.1.x prior to 5.1.5 contain an insecure randomness vulnerability when using SecureRandomFactoryBean#setSeed to configure a SecureRandom instance. In order to be impacted, an honest application must provide a seed and make the resulting random material available to an attacker for inspection.
Affected Spring Products and Versions
Spring Security 4.2 to 4.2.11
Spring Security 5.0 to 5.0.11
Spring Security 5.1 to 5.1.4
Mitigation
Users of affected versions should apply the following mitigation:
4.2.x users should upgrade to 4.2.12
5.0.x users should upgrade to 5.0.12
5.1.x users should upgrade to 5.1.5
Credit
This issue was identified and responsibly reported by Thijs Alkemade.
Spring Security OAuth, versions 2.3 prior to 2.3.5, and 2.2 prior to 2.2.4, and 2.1 prior to 2.1.4, and 2.0 prior to 2.0.17, and older unsupported versions could be susceptible to an open redirector attack that can leak an authorization code. A malicious user or attacker can craft a request to the authorization endpoint using the authorization code grant type, and specify a manipulated redirection URI via the "redirect_uri" parameter. This can cause the authorization server to redirect the resource owner user-agent to a URI under the control of the attacker with the leaked authorization code.
This vulnerability exposes applications that meet all of the following requirements:
Act in the role of an Authorization Server (e.g. @EnableAuthorizationServer)
Uses the DefaultRedirectResolver in the AuthorizationEndpoint
This vulnerability does not expose applications that:
Act in the role of an Authorization Server and uses a different RedirectResolver implementation other than DefaultRedirectResolver
Act in the role of a Resource Server only (e.g. @EnableResourceServer)
Act in the role of a Client only (e.g. @EnableOAuthClient)
Affected Spring Products and Versions
Spring Security OAuth 2.3 to 2.3.4
Spring Security OAuth 2.2 to 2.2.3
Spring Security OAuth 2.1 to 2.1.3
Spring Security OAuth 2.0 to 2.0.16
Older unsupported versions are also affected
Mitigation
Users of affected versions should apply the following mitigation:
<strong>2.3.x</strong> users should upgrade to <strong>2.3.5</strong>
<strong>2.2.x</strong> users should upgrade to <strong>2.2.4</strong>
<strong>2.1.x</strong> users should upgrade to <strong>2.1.4</strong>
<strong>2.0.x</strong> users should upgrade to <strong>2.0.17</strong>
Older versions should upgrade to a supported branch
There are no other mitigation steps necessary.
For users of Spring Boot 1.5.x and Spring IO Platform Cairo, it is highly recommended to override the spring-security-oauth version to the latest version containing the patch for the CVE. In order to override the version, you need to declare/set the property spring-security-oauth.version.
Below are instructions for users of Spring Boot 1.5.x.
To override a property using Maven, declare the property in your pom’s section:
2.0.17.RELEASE
To override a property using Gradle, configure the value in your build.gradle script:
NOTE: The same instructions apply for users of Spring IO Platform Cairo. However, the version to specify is 2.2.4.RELEASE.
Credit
This issue was identified and responsibly reported by Dirk Koehler (github.com/phrinx) from dotloop. Special thanks to Macchinetta Framework Development Team from NTT, NTT Comware, NTT DATA…
Spring Integration (spring-integration-xml and spring-integration-ws modules), versions 4.3.18, 5.0.10, 5.1.1, and older unsupported versions, were susceptible to XML External Entity Injection (XXE) when receiving XML data from untrusted sources.
Affected Spring Products and Versions
Spring Integration versions 5.1.1, 5.0.10, 4.3.18 and older
Mitigation
Users of affected versions should apply the following mitigation:
Upgrade spring-integration-ws, spring-integration-xml to 4.3.19, 5.0.11, 5.1.2 or later.
Spring Integration components that exhibited this vulnerability now disable the features as advised in the reference cheat sheet [1] by default, but allow user configuration of the components if the feature can be enabled because XML is received from a trusted source.
Spring Web Services, versions 2.4.3, 3.0.4, and older unsupported versions of all three projects, were susceptible to XML External Entity Injection (XXE) when receiving XML data from untrusted sources.
Affected Spring Products and Versions
Spring Web Services versions 2.4.3, 3.0.4 and older
Mitigation
Users of affected versions should apply the following mitigation:
Upgrade spring-ws, spring-xml jars to 2.4.4, 3.0.6 or later
Spring Web Services components that exhibited this vulnerability now disable the features as advised in the reference cheat sheet [1] by default, but allow user configuration of the components if the feature can be enabled because XML is received from a trusted source.
Spring Batch versions 3.0.9, 4.0.1, 4.1.0, and older unsupported versions, were susceptible to XML External Entity Injection (XXE) when receiving XML data from untrusted sources.
Affected Spring Products and Versions
Spring Batch versions 3.0.9, 4.0.1, 4.1.0 and older
Mitigation
Users of affected versions should apply the following mitigation:
Upgrade spring-batch jars to 3.0.10, 4.0.2, 4.1.1 or later
Spring Batch components that exhibited this vulnerability now disable the features as advised in the reference cheat sheet [1] by default, but allow user configuration of the components if the feature can be enabled because XML is received from a trusted source.
Spring Security versions 5.1.x prior to 5.1.2 contain an authorization bypass vulnerability during JWT issuer validation. In order to be impacted, the same private key for an honest issuer and a malicious user must be used when signing JWTs. In that case, a malicious user could fashion signed JWTs with the malicious issuer URL that may be granted for the honest issuer.
Affected Spring Products and Versions
Spring Framework 5.1 to 5.1.1
Mitigation
Users of affected versions should apply the following mitigation:
5.1.x users should upgrade to 5.1.2
There are no other mitigation steps necessary.
Credit
This issue was identified and responsibly reported by Björn Bilger.
Spring Framework, version 5.1, versions 5.0.x prior to 5.0.10, versions 4.3.x prior to 4.3.20, and older unsupported versions on the 4.2.x branch provide support for range requests when serving static resources through the ResourceHttpRequestHandler, or starting in 5.0 when an annotated controller returns an org.springframework.core.io.Resource. A malicious user (or attacker) can add a range header with a high number of ranges, or with wide ranges that overlap, or both, for a denial of service attack.
This vulnerability affects applications that depend on either spring-webmvc or spring-webflux. Such applications must also have a registration for serving static resources (e.g. JS, CSS, images, and others), or have an annotated controller that returns an org.springframework.core.io.Resource.
Spring Boot applications that depend on spring-boot-starter-web or spring-boot-starter-webflux are ready to serve static resources out of the box and are therefore vulnerable.
Affected Spring Products and Versions
Spring Framework 5.1
Spring Framework 5.0.0 to 5.0.9
Spring Framework 4.3 to 4.3.19
Older unsupported versions going back to 4.2 are also affected
Mitigation
Users of affected versions should apply the following mitigation:
5.1 users should upgrade to 5.1.1
5.0.x users should upgrade to 5.0.10
4.3.x users should upgrade to 4.3.20
4.2.x users should upgrade to a supported branch.
No further mitigation steps are necessary.
Note the following when evaluating the impact:
Support for Range requests was introduced in version 4.2. Therefore versions prior to 4.2 are not affected by this issue.
Support for returning an org.springfamework.core.io.Resource from an annotated controller was introduced in 5.0. Therefore versions prior to 5.0 can only be impacted through a registration to serve static resources.
Credit
This issue was identified and responsibly reported by Nicholas Starke from Aruba Threat Labs.
Spring Security OAuth, versions 2.3 prior to 2.3.4, and 2.2 prior to 2.2.3, and 2.1 prior to 2.1.3, and 2.0 prior to 2.0.16, and older unsupported versions could be susceptible to a privilege escalation under certain conditions. A malicious user or attacker can craft a request to the approval endpoint that can modify the previously saved authorization request and lead to a privilege escalation on the subsequent approval. This scenario can happen if the application is configured to use a custom approval endpoint that declares AuthorizationRequest as a controller method argument.
This vulnerability exposes applications that meet all of the following requirements:
Act in the role of an Authorization Server (e.g. @EnableAuthorizationServer)
Use a custom Approval Endpoint that declares AuthorizationRequest as a controller method argument
This vulnerability does not expose applications that:
Act in the role of an Authorization Server and use the default Approval Endpoint
Act in the role of a Resource Server only (e.g. @EnableResourceServer)
Act in the role of a Client only (e.g. @EnableOAuthClient)
Affected Spring Products and Versions
Spring Security OAuth 2.3 to 2.3.3
Spring Security OAuth 2.2 to 2.2.2
Spring Security OAuth 2.1 to 2.1.2
Spring Security OAuth 2.0 to 2.0.15
Older unsupported versions are also affected
Mitigation
Users of affected versions should apply the following mitigation:
2.3.x users should upgrade to 2.3.4
2.2.x users should upgrade to 2.2.3
2.1.x users should upgrade to 2.1.3
2.0.x users should upgrade to 2.0.16
Older versions should upgrade to a supported branch
There are no other mitigation steps required.
Credit
This issue was identified and responsibly reported by Alvaro Muñoz (@pwntester) from Micro Focus.
spring-amqp, 1.x versions prior to 1.7.10, 2.x versions prior to 2.0.6 expose a man-in-the middle vulnerability.
The Spring RabbitMQ Java Client does not perform hostname validation.
This means that SSL certificates of other hosts are blindly accepted as long as they are trusted.
To exploit this vulnerability an attacker has to perform a man-in-the-middle (MITM) attack between a Java application using the Spring RabbitMQ Java Client and an RabbitMQ server it's connecting to.
TLS normally protects users and systems against MITM attacks, it cannot if certificates from other trusted hosts are accepted by the client.
Spring AMQP uses the RabbitMQ amqp-client java library for communication with RabbitMQ.
It uses the RabbitConnectionFactoryBean to create/configure the connection factory.
Affected Spring Products and Versions
Spring-AMQP versions prior to 1.7.10 and 2.0.6
RabbitMQ amqp-client versions prior to 4.8.0 and 5.4.0
Mitigation
Users of affected versions should apply the following mitigation:
Upgrade to the 1.7.10.RELEASE or 2.0.6.RELEASE and set the enableHostnameValidation property to true. Override the transitive amqp-client version to at least 4.8.0 and 5.4.0, respectively
The upcoming 2.1.0.RELEASE will set the property to true by default.
If you are using the amqp-client library directly to create a connection factory, refer to its javadocs for the enableHostnameValidation() method.
Credit
This issue was identified and responsibly reported by Peter Stöckli of Alphabot Security, Switzerland.
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.