Creating temporary files using insecure methods exposes the application to race conditions on filenames: a malicious user can try to create a file with a predictable name before the application does. A successful attack can result in other files being accessed, modified, corrupted or deleted. This risk is even higher if the application run with elevated permissions.
In the past, it has led to the following vulnerabilities:
``Path.GetTempFileName()``generates predictable file names and is inherently unreliable and insecure. Additionally, themethod will raise an``IOException`` if it is used to create more than 65535 files without deleting previous temporary files.