Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T00002 - Insecure temporary file creation methods should not be used #43568

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

guilhermelinosp
Copy link

OWASP - Insecure Temporary File

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Sep 19, 2024
var tempDepsFile = Path.GetTempFileName();
var tempDepsFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying from #43569 (comment):

How is this more secure? Seems worse to me. GetTempFileName creates the file to make sure that the name is unique, but GetRandomFileName doesn't; then the actual creation later may be vulnerable to symlink attack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants