Repository navigation
Conversation
Girgias
left a comment
There was a problem hiding this comment.
This seems sensible, but not super familiar with RFC 1867, maybe @iluuu1994 or @bukka have some comments?
164e5fb to
abd2d93
Compare
|
I have added missing entry in NEWS. |
abd2d93 to
1c84f86
Compare
1c84f86 to
43cb7db
Compare
43cb7db to
18ab329
Compare
18ab329 to
3466474
Compare
b989b90 to
07f8ffa
Compare
07f8ffa to
f47dbb9
Compare
|
Is it safe to merge this PR? I have rebased on fresh branch right now. |
|
This didn't have a proper review yet, it's on my list. But feature freeze... |
|
Changes look good to me. How does this relate to PHP RFC: Deprecate GET/POST sessions? |
f47dbb9 to
b53f0a4
Compare
|
I removed defaults from INI section in test. |
I think it would make sense to explicitly set |
|
What's the point if this is default and it will be removed in next PHP versions? |
|
I thought it would be needed because it is mentioned in the title that it tests this condition:
If you say |
441bc56 to
dedab5a
Compare
|
Thanks @Sjord , I reworded the title of test a bit |
dedab5a to
47e2045
Compare
|
Would be nice to patch this gap in 8.6. Do you think it's feasible? |
47e2045 to
6d19f28
Compare
|
With use_only_cookies=1, the progress handler now ignores the session ID in the PHPSESSID POST field, so the test never started it. The test now sends the ID as a cookie, and every request runs out of memory at the same place as before. |
iluuu1994
left a comment
There was a problem hiding this comment.
Sorr, it seems I forgot to submit the review.
This won't make it into 8.6 as it's too late, but it looks correct. Technically this is breaking long-standing behavior, but session upload progress should barely be used.
| progress = ecalloc(1, sizeof(php_session_rfc1867_progress)); | ||
| progress->content_length = data->content_length; | ||
| progress->sname_len = strlen(PS(session_name)); | ||
| progress->sname_len = strlen(PS(session_name)); |
There was a problem hiding this comment.
Please avoid unrelated whitespace changes. (doesn't seem like a mistake, somebody wanted to align with the line below)
There was a problem hiding this comment.
I removed this change during merge.
* 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 ...
The RFC1867 multipart callback captures the session ID from form data to identify which session to write the upload progress to. When
session.use_only_cookies=1this capture was not guarded, allowing the session ID to be accepted from a form field despite the setting's documented contract of "only accept session ID from cookies."php_session_rfc1867_early_find_sid()already guards $_GET lookup behinduse_only_cookies, but the form field capture inMULTIPART_EVENT_FORMDATAhad no such guard.This commit adds the missing check so that when
use_only_cookies=1and no cookie is present, the form-supplied session ID is ignored and the upload progress is written to a randomly generated session instead.I don't know if this is a security fix, so I point to the 8.4 branch.