Arbitrary Code Execution

Affecting org.springframework.boot:spring-boot-starter-data-rest artifact, versions [,0]

Amendment

This was deemed not a vulnerability.

Overview

org.springframework.boot:spring-boot-starter-data-rest provides a flexible and configurable mechanism for writing simple services that can be exposed over HTTP.

Affected versions of the package are vulnerable to Arbitrary Code Execution. It is caused due to the way Spring uses it's own expression language in the Data REST component.

The Spring Expression Language (SpEL) is an expression language (similar to OGNL, MVEL, and JBoss EL) which serves as the foundation for expression evaluation within the Spring portfolio. It supports querying and manipulating an object graph at runtime.

User input was not validated upon sending a PATCH request with a path parameter to spring-data-rest servers. An attacker may sumit a specially crafted PATCH request with a path containing SpEL syntax, and the Spring REST server, would in turn run these expressions.

An example for an invalid PATCH request:

[
    {"op":"replace", "path":"<Malicious SpEL code>", "value": "bar" }
]

Remediation

Upgrade org.springframework.boot:spring-boot-starter-data-rest to version 1.5.9, 2.0.0M6 or higher.

References

Do your applications use this vulnerable package?

CVSS Score

9.8
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Credit
Man Yue Mo
CVE
CVE-2017-8046
CWE
CWE-94
Snyk ID
SNYK-JAVA-ORGSPRINGFRAMEWORKBOOT-31664
Disclosed
07 Sep, 2017
Published
16 Apr, 2018