# CVE-2022-22965 PoC - Payara Arbitrary File Download
Minimal example of how to reproduce CVE-2022-22965 Spring vulnerability in Payara/Glassfish.
Alternative payload for Payara/Glassfish that allows the malicious user to set an arbitrary web root, leading to arbitrary file download.
## Run using docker compose
1. Build the application using Docker compose
```shell
docker-compose up --build
```
2. To test the app browse to [http://localhost:8080/handling-form-submission-complete/greeting](http://localhost:8080/handling-form-submission-complete/greeting)
3. Run the exploit
```shell
./exploits/run.sh
```
## Conditions
The exploit requires Java 9 or above because `module` property was added in Java 9.
[4.0K] /data/pocs/d7d25e6e250693bed73b5aa76d1106f8d19ac231
├── [ 505] build.gradle
├── [ 163] docker-compose.yml
├── [ 339] Dockerfile
├── [4.0K] exploits
│ └── [ 287] run.sh
├── [4.0K] gradle
│ └── [4.0K] wrapper
│ ├── [ 58K] gradle-wrapper.jar
│ └── [ 200] gradle-wrapper.properties
├── [5.6K] gradlew
├── [2.7K] gradlew.bat
├── [9.7K] mvnw
├── [6.2K] mvnw.cmd
├── [1.7K] pom.xml
├── [ 740] README.md
├── [ 46] settings.gradle
└── [4.0K] src
├── [4.0K] main
│ ├── [4.0K] java
│ │ └── [4.0K] com
│ │ └── [4.0K] example
│ │ └── [4.0K] handlingformsubmission
│ │ ├── [ 951] GreetingController.java
│ │ ├── [ 330] Greeting.java
│ │ └── [2.1K] HandlingFormSubmissionApplication.java
│ └── [4.0K] resources
│ └── [4.0K] templates
│ ├── [ 560] greeting.html
│ └── [ 400] result.html
└── [4.0K] test
└── [4.0K] java
└── [4.0K] com
└── [4.0K] example
└── [4.0K] handlingformsubmission
└── [1.9K] HandlingFormSubmissionApplicationTest.java
16 directories, 19 files