Lucene search

K
huntrReady-researchA3867B4E-6701-4418-8C20-3C6E7084A44A
HistoryJan 05, 2023 - 1:42 p.m.

Insecure Temporary File

2023-01-0513:42:55
ready-research
www.huntr.dev
5
insecure file handling
deprecated function
exclusive access

EPSS

0

Percentile

9.0%

Description

transformers 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.

Functions that create temporary file names (such as tempfile.mktemp()) are fundamentally insecure, as they do not ensure exclusive access to a file with the temporary name they return. The file name returned by these functions is guaranteed to be unique on creation but the file must be opened in a separate operation. There is no guarantee that the creation and open operations will happen atomically. This provides an opportunity for an attacker to interfere with the file before it is opened.

Use mkstemp() instead of tempfile.mktemp().

EPSS

0

Percentile

9.0%

Related for A3867B4E-6701-4418-8C20-3C6E7084A44A