Directory traversal attacks
Hi Ray, following my client's recent penetration test on their website I think I've now fixed all the vulnerabilities they picked up on, with your help which is much appreciated as always. I only have one outstanding item which I wondered if you could advise on? I use both ordinary download links to files and also download behaviors throughout the site. The pen tests have said this:
"It was possible to download arbitrary files from the web server by manipulating the file details being downloaded by the application. By utilising special characters to move through the directory tree of the web server it was possible to escape the directory being accessed to retrieve other files from the web server. Ensure that the application does not allow for special characters to be interpreted by the backend server when a user attempts to download files via the application."
They sent the attached screenshot to demonstrate. I think they're saying that download links have to be sanitised to remove special characters, however I'm not sure how I can do this and apply to existing download links/behaviors and for the links still to function properly. There's an article here: https://www.invicti.com/blog/web-security/directory-path-traversal-attacks/ but I'm not really any the wiser on how to fix this vulnerability. Can you help?