Insecure Temporary File in tensorflow/tensorflow


Reported on

Jan 5th 2022


tensorflow package is using the deprecated function tempfile.mktemp() which is not secure. Because a different process may create a file with this name in the time between the call to mktemp() and the subsequent attempt to create the file by the first process.


Availability will get effected because of this vulnerability.


Use mkstemp() instead of tempfile.mktemp()

We are processing your report and will contact the tensorflow team within 24 hours. 5 months ago
We have contacted a member of the tensorflow team and are waiting to hear back 5 months ago
tensorflow/tensorflow maintainer
5 months ago


Hello. Mihai from TensorFlow Security here.

Thank you for the report. We will issue a fix and patch.

tensorflow/tensorflow maintainer validated this vulnerability 5 months ago
Srikanth Prathi has been awarded the disclosure bounty
The fix bounty is now up for grabs
5 months ago
Mihai Maruseac
5 months ago


Hi. We already published the fix at (and several related commits over today)

Now we need to patch this for the planned releases.

Srikanth Prathi
5 months ago


Hello Mihai, Thank you

tensorflow/tensorflow maintainer confirmed that a fix has been merged on a0395a 4 months ago
Srikanth Prathi has been awarded the fix bounty has been validated
tensorflow/tensorflow maintainer
4 months ago


(The commit hash above is partial, there are several commits but the huntr UI does not allow properly selecting it)

to join this conversation