yfszzx / stable-diffusion-webui-images-browser

an images browse for stable-diffusion-webui
489 stars 235 forks source link

Path traversal exploit allowing you to see any image on a PC and moving ANY FILE on a pc somewhere else #60

Open DAMcraft opened 1 year ago

DAMcraft commented 1 year ago

I was testing around and boi, this is not good.

You can basically get all images from any directory by using the "Others" directory. Simply using normal path traversal will not work image That is taken care of, but I first found out that you could send an own fetch-request with a page index. Later I found out this can be done simply by clicking on the "First page" button, as it'd take the input in the text field.

So, first, load a normal dir, like "." image

Edit the text input to stuff like "../../../../../../projects/.random/example_folder", and hit "First page" image

The folder will in fact load! image This means you can read any images onanother pc!

Now, I can do one better: image The "Move to favorites" button moves the Image out of the current folder to your favorite image folder. Now, here, there is no check if it is actually an image! Simply modify the request: Here, I will move a valuable file called dont_move_me.txt image This allows you moving any file away, basically allowing to delete any file you want.

Please fix immediately.