A temporary file name is made with a function that leaves time for another process to take the name

tx0/cpp:insecure-temporary-filedefaultwarningsecurity/filesdepth fastsecurity, cwe-377

What it finds

tmpnam, tempnam and mktemp return a name that does not exist yet, and the file is created in a second step; in between another process can create the file or a link of that name and have the program write where it chooses. mkstemp and tmpfile create the file in one step.

From the rule's source, insecure_temporary_file.rs.

Turn it on, off or suppress it

The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:insecure-temporary-file" = "off"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:insecure-temporary-file] reason="..."

tx0 explain tx0/cpp:insecure-temporary-file shows the same in the terminal. Found a false positive? Report it.