As of late, I have discovered a genuine vulnerability RCE (Remote Command Execution) in one of the open-source software to be specific “SeedDMS”. Through this vulnerability, an attacker can upload a backdoor/web shell and execute commands on the server.
Because of the security concerns and impediments, I wouldn't be uploading any snippets or screenshots here but would try to explain it as brief as could be expected under the circumstances.
How about we get into the Exploit part as follows:
- Sign in to the application and inside any folder upload a PHP web shell file (there is no restriction or validation on the uploaded file).
- Presently in URL, you can observe a document id corresponding to the file uploaded (This ID is actually the folder name, I will jump on to this towards the end of the blog as to how I learned about the same)
- Now go to the following URL "example.com/data/1048576/DOCUMENT_ID/1.php"
That is it!!!... Right it might sound very straightforward and yes it is however the tricky part was to get to know the path of the file being uploaded and even the name of the uploaded file to execute the same. For that, I downloaded the SeedDMS open source bundle to understand the directory structure and observed the data folder and the 1048576 default folder. And lastly using some hit and trials was able to deduce that file name was getting renamed to "1" with extension left unchanged.
A lesson to Learn:
- Improve your observation skills to exploit these kinds of findings, try observing the patterns.
- The "data" folder should be placed outside of web directory and access to it should be restricted.
P.S. I have already reached out to the vendor and their help was very quick. They have fixed it and issued an update for the same.
https://sourceforge.net/p/seeddms/code/ci/master/tree/CHANGELOG
Comments
Post a Comment