CVE-2016-4977 Spring Security OAuth vulnerable to remote code execution (RCE) via specially crafted request using whitelabel views
Attackers can execute arbitrary code by injecting Spring SpEL expressions into the response_type parameter during authorization requests.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2016-4977?
CVE-2016-4977 is a high-severity code injection vulnerability in Pivotal Spring Security OAuth, published on 25 May 2017. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
When processing authorization requests using the whitelabel views in Spring Security OAuth 2.0.0 to 2.0.9 and 1.0.0 to 1.0.5, the response_type parameter value was executed as Spring SpEL which enabled a malicious user to trigger remote code execution via the crafting of the value for response_type.
Weakness: CWE-19
Which versions are affected by CVE-2016-4977?
4 open source packages ship an affected version, including org.springframework.security.oauth:spring-security-oauth2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.springframework.security.oauth:spring-security-oauth2 Maven | From 1.0.0 | 1.0.5 |
org.springframework.security.oauth:spring-security-oauth2 Maven | From 1.0.0 | 1.0.5 |
org.springframework.security.oauth:spring-security-oauth2 Maven | From 2.0.0 | 2.0.10 |
org.springframework.security.oauth:spring-security-oauth2 Maven | From 2.0.0 | 2.0.10 |
Products include Pivotal Spring Security Oauth.
How do I fix CVE-2016-4977?
Upgrade org.springframework.security.oauth:spring-security-oauth2 to a fixed version for your release line: 1.0.5 or 2.0.10.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2016-4977 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2016-4977 exists.
Public exploit code: 1 Nuclei template and 3 proofs of concept on GitHub.
Sources
Also known as GHSA-7q9c-h23x-65fq.