This is not a CSRF attack. You may or may not have one of those as well - can't say.
It's a directory traversal attack.
we are creating a path with GUID like : Server.MapPath("~\folder\" + GUID)
Then that path can end up outside the ~\folder
root by including 'go-up-a-directory' strings (..
) in the GUID variable. Thus they may be able to access any file on your server's filesystem - not a good thing.
Before using user input in a filename, you need to check that the it is in the limited format you expect. As well as directory traversal attacks, there are some other odd things you can do with Windows filenames (like reserved names, invalid names, accidental UNC paths, unsupported Unicode characters etc), so you should use strict whitelist validation to ensure you only get names you expect.
For a real GUID, you'd want to do a validation against the regex:
[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}
Or if you've got .NET 4.5 you can use Guid.TryParse.
Also: if someone is actively trying to exploit this, and it's not someone in the company doing approved security testing, you've got problems and should be investigating where the attacks are coming from.