CVE-2016-4977· pivotal / spring security oauth· CWE-19
Spring Security OAuth2 Remote Command Execution
Spring Security OAuth versions 2.0.0 to 2.0.9 and 1.0.0 to 1.0.5 contain a remote command execution vulnerability. When processing authorization requests using the whitelabel views, the response_type parameter value was executed as Spring SpEL which enabled a malicious user to trigger remote command execution via the crafting of the value for response_type.
Impact
Successful exploitation of this vulnerability can lead to remote code execution, compromising the affected system.
Fix
Users of 1.0.x should not use whitelabel views for approval and error pages. Users of 2.0.x should either not use whitelabel views for approval and error pages or upgrade to 2.0.10 or later.
How to confirm it
Send: GET {{BaseURL}}/oauth/authorize?response_type=${13337*73331}&client_id=acme&scope=openid&redirect_uri=http://test
Positive when: contains "Unsupported response types: [978015547]" AND status 400Run it with nuclei: nuclei -id CVE-2016-4977 -u <target>. This check is not marked as verified by its authors.
The full check
id: CVE-2016-4977
info:
name: Spring Security OAuth2 Remote Command Execution
author: princechaddha
severity: high
description: Spring Security OAuth versions 2.0.0 to 2.0.9 and 1.0.0 to 1.0.5 contain a remote command execution vulnerability. When processing authorization requests using the whitelabel views, the response_type parameter value was executed as Spring SpEL which enabled a malicious user to trigger remote command execution via the crafting of the value for response_type.
impact: |
Successful exploitation of this vulnerability can lead to remote code execution, compromising the affected system.
remediation: Users of 1.0.x should not use whitelabel views for approval and error pages. Users of 2.0.x should either not use whitelabel views for approval and error pages or upgrade to 2.0.10 or later.
reference:
- https://github.com/vulhub/vulhub/blob/master/spring/CVE-2016-4977/README.md
- https://tanzu.vmware.com/security/cve-2016-4977
- https://nvd.nist.gov/vuln/detail/CVE-2016-4977
- https://pivotal.io/security/cve-2016-4977
- http://www.openwall.com/lists/oss-security/2019/10/16/1
classification:
cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score: 8.8
cve-id: CVE-2016-4977
cwe-id: CWE-19
epss-score: 0.80016
epss-percentile: 0.99618
cpe: cpe:2.3:a:pivotal:spring_security_oauth:1.0.0:*:*:*:*:*:*:*
metadata:
max-request: 1
vendor: pivotal
product: spring_security_oauth
tags: cve2016,cve,oauth2,oauth,rce,ssti,vulhub,spring,pivotal,vkev,vuln
http:
- method: GET
path:
- "{{BaseURL}}/oauth/authorize?response_type=${13337*73331}&client_id=acme&scope=openid&redirect_uri=http://test"
matchers-condition: and
matchers:
- type: word
part: body
words:
- "Unsupported response types: [978015547]"
- type: status
status:
- 400References
- https://github.com/vulhub/vulhub/blob/master/spring/CVE-2016-4977/README.md
- https://tanzu.vmware.com/security/cve-2016-4977
- https://nvd.nist.gov/vuln/detail/CVE-2016-4977
- https://pivotal.io/security/cve-2016-4977
- http://www.openwall.com/lists/oss-security/2019/10/16/1
Use this check only on systems you are authorised to test. Where the data comes from