You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Temporary files created with a predictable name and without exclusive creation #343
Several temporary files are created in the system temporary directory with a predictable name and without exclusive creation:
FileSplitterTask (file_splitter): php_<uniqid>.tmp, opened with wb;
CsvSplitterTask (csv_splitter): php_<uniqid>.csv, opened with wb+;
SubprocessInstance (JSON buffer of ProcessLauncherTask with json_buffering): cdm_buffer_<uniqid>.json-stream, written by the sub-process.
uniqid() is derived from the current time; fopen() with w follows an existing symbolic link and truncates its target; the files get the permissions of the umask (usually readable by every user). On a shared host, another user can read the data of the split files and buffers, or make the process write into another file by creating a symbolic link with the expected name.
Fix: create these files with a random name (random_bytes()), exclusively (fopen() mode x, which fails on an existing path, symbolic links included) and readable by their owner only (0600), through a new internal TemporaryFile helper.
Found during the global audit after the 5.4 release (process-bundle-audit.md#87).
Activity
#343 - Fix PHPStan
Merge pull request #344 from cleverage/343