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

fix(build): use NamedTemporaryFile instead of insecure mktemp function #19387

Closed

Conversation

AHasanin
Copy link
Contributor

As mktemp introduces security vulnerabilities because there is no guarantee that the creation and open operations will happen atomically, we can use either NamedTemporaryFile or TemporaryFile from the tempfile module in python.

https://codeql.github.com/codeql-query-help/python/py-insecure-temporary-file/

@AHasanin AHasanin requested a review from a team as a code owner December 21, 2022 11:45
@AHasanin AHasanin requested review from shariquerik and removed request for a team December 21, 2022 11:45
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Dec 21, 2022
@ankush
Copy link
Member

ankush commented Dec 21, 2022

build is atomic after #19162, security wise I don't think this is an issue as it's just static assets?

@ankush ankush self-assigned this Dec 21, 2022
@ankush ankush removed the request for review from shariquerik December 21, 2022 13:44
@AHasanin
Copy link
Contributor Author

I agree with that but despite using it for building assests it is vulnerable as the name maybe hijacked by some user causing some harm to programs and also its deprecated since python 2.3, we can replace it to be on safe side.

@ankush ankush marked this pull request as draft December 22, 2022 08:57
@ankush
Copy link
Member

ankush commented Dec 22, 2022

@AHasanin agree. Check test failures, doesn't seem to be working as expected.

@ankush ankush added tests-failing Automated tests are failing. Please resolve if it is due to the changes in current PR. and removed add-test-cases Add test case to validate fix or enhancement labels Dec 22, 2022
@AHasanin AHasanin closed this Dec 22, 2022
@AHasanin AHasanin reopened this Dec 22, 2022
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Dec 22, 2022
@AHasanin AHasanin closed this Dec 25, 2022
@AHasanin AHasanin mentioned this pull request Dec 25, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement tests-failing Automated tests are failing. Please resolve if it is due to the changes in current PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants