[php-src] Issue #24874: [SECURITY] BUG-049: Race Condition - Insecure Temporary File Creation - mktemp()
| From: | Codeleafly | Date: | Wed, 28 Oct 2026 01:50:32 +0000 |
| Subject: | [php-src] Issue #24874: [SECURITY] BUG-049: Race Condition - Insecure Temporary File Creation - mktemp() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-253326@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/24874
Author: Codeleafly
## 🐛 Security Bug Report
**Bug ID:** BUG-049
**Category:** Race Condition
**Subcategory:** Insecure Temporary File Creation - mktemp()
**Severity:** High
**CWE:** CWE-367
**CVSS Score:** 7.0
**File:**
main/php_open_temporary_file.c
**Line:** 210
**Status:** UNFIXED
**Verified:** True
### Description
mktemp() called without atomic file creation. Time-of-check to time-of-use (TOCTOU) race condition
allows attacker to create symlink before file is opened.
### Impact
Arbitrary file overwrite, privilege escalation, sensitive data exposure.
### Remediation
Replace mktemp() with mkstemp() which creates file atomically with O_EXCL flag.
### Exploitability
Local, requires race condition exploitation
### Source
- Repository: https://github.com/php/php-src/
- Branch: master
- Analysis Date: 2026-10-27T16:38:37.937347Z
---
*Auto-generated from static security analysis of php-src.*
*Total bugs found: 161*