News for hackers. Stuff that matters.
Re:Finding an arbitrary file upload vulnerability in a files... by fake-name on Sunday May 14, 2017 @03:20AM (#14334649)
> I thought about a possible fix for a while, but in the end decided that the quickest and easiest fix would be to adjust the regular expressio

..... WHAT?

Python has a suite of facilities exactly for this very kind of problem.

Literally, the solution is "os.path.abspath(filename).startswith(os.path.abspath(dlfolder))"

This should, in all cases, return true if the filename is within the download folder directory, and false for any other case.

Re:Finding an arbitrary file upload vulnerability in a files... by jwilk on Sunday May 14, 2017 @07:16AM (#14335135)
It doesn't do the right thing if dlfolder doesn't end with a slash.