TMP101

Using a hardcoded path to read or write temporary files is insecure and leaves it open to attackers replacing the file contents.

Example

with open('/tmp/my_app', 'w') as tmp_file:
    tmp_file.write('data')

Fixes

  • Use tempfile.mkstemp() or another standard library function for generating temporary file names