Repository navigation
Conversation
Calling request_parse_body() on a multipart request whose body was already parsed (at startup, or by a previous call) replaced SG(rfc1867_uploaded_files). The files from the first parse were no longer accepted by is_uploaded_file() and move_uploaded_file(), and were never deleted at the end of the request.
devnexen
reviewed
Nov 12, 2026
devnexen
approved these changes
Nov 12, 2026
LamentXU123
added a commit
that referenced
this pull request
Nov 12, 2026
* PHP-8.6: Fix uploaded files leak in request_parse_body() (#25387)
yurieashi
pushed a commit
to Kyouroga/php-src
that referenced
this pull request
Nov 12, 2026
* PHP-8.4: Fix uploaded files leak in request_parse_body() (php#25387)
yurieashi
pushed a commit
to Kyouroga/php-src
that referenced
this pull request
Nov 12, 2026
* PHP-8.5: Fix uploaded files leak in request_parse_body() (php#25387)
arnaud-lb
added a commit
to pavimus/php-src
that referenced
this pull request
Nov 16, 2026
* PHP-8.4: (262 commits) Fix phpGH-25474: version_compare() numeric parts overflow long on Windows (php#25475) ext/session: prevent creation of fixed sid in php_session_rfc1867 (phpGH-22113) Forbid \C in patterns enabling UTF mode with (*UTF) (phpGH-25452) Fix phpGH-24743: var_export() ignores exception from lazy object init (php#24746) ext/snmp: Copy the context name in SNMP::setSecurity() Fix phpGH-25434: C14NFile() skips namespace relinking on success Fix uploaded files leak in request_parse_body() (php#25387) Fix phpGH-25094: NULL dereference in SOAP get_doc_function() with missing parts Pin Linux x86 CI to Ubuntu 24.04 (php#25416) Fix phpGH-25359: tracing JIT drops reference type of a named by-ref argument Fix AST export of by-reference property hooks (phpGH-25069) fix test when tmp-php.ini is used Fix stack overflow in filter_var() and filter_var_array() (php#25349) Align the Windows OPcache JIT buffer (php#25262) Fix phpGH-25311: Assertion ret == SUCCESS in array_map()/array_filter() after delayed out-of-memory Fix tracing JIT reading the int result of ++/-- on a reference as a double Fix error buffer cleanup in phar_open_parsed_phar() (php#25376) Fix phpGH-25306: Assertion status == LXB_STATUS_OK in dom_parse_selector when lexbor allocation fails Fix AST printing dropping readonly on promoted parameters (phpGH-25207) ext/gd: blame the points array when a polygon has too few points ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on the "Request lifecycle hooks for SAPIs with a worker mode" RFC, I discovered a bug affecting existing SAPIs.
Calling
request_parse_body()on a multipart request whose body was already parsed replacesSG(rfc1867_uploaded_files)with a new instance. This happens when the body was parsed at startup (POST withenable_post_data_reading=1), or when the userlandrequest_parse_body()function is called several times.The files from the previous parses are then lost. This patch reuses the existing table instead.
Related to #24802 and #24987, but neither the same bug nor the same fix.
AI: Claude Code used to find the issue and write the patch.