Skip to content

Stdlib: deny CurlHandle/Multi/Share serialize like Zend (#23074) - #23079

Merged
PurHur merged 1 commit into
masterfrom
fix/23074-curlhandle-serialize-deny
Jul 25, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/23074-curlhandle-serialize-deny

Conversation

@PurHur

@PurHur PurHur commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extend CurlFileSerializeDeny (from Regression: CURLFile serialize() allowed — Zend Exception "not allowed" (ext/curl/curl_file.c) #23064) so CurlHandle, CurlMultiHandle, CurlShareHandle, and persistent share handles throw Zend-identical Exception: Serialization of '…' is not allowed / unserialize deny.
  • php-src: ext/curl/curl.stub.php @not-serializable; shared path remains VmSerializeSerializeJitHelper (PHP-in-PHP, no new runtime/ C).
  • Compliance: curl_handle_serialize_disallowed.phpt + curl_multi_share_serialize_disallowed.phpt (split so multi/share are not after a CurlHandle throw — guest Exception message retention quirk).

Closes #23074

Test plan

  • php bin/vm.php test/repro/issue_23074_curlhandle_serialize_deny.php
  • php bin/jit.php test/repro/issue_23074_curlhandle_serialize_deny.php
  • ./script/phpunit.sh --filter 'curl_handle_serialize_disallowed|curl_multi_share_serialize_disallowed' (VM+JIT, 4 tests)
  • php script/bootstrap-inventory.php --check → OK 6531/6531
  • Native AOT of this repro blocked independently: curl_init() not on JIT/AOT (Stdlib: curl_share_init()/curl_share_setopt()/curl_share_close() — shared cURL handle pool missing (ext/curl) #6322); bare try/throw Exception AOT currently fails with Current basic block has no parent function; unserialize() AOT reports result type unsupported. Deny lives in shared VmSerialize already exercised by JIT.

Verification transcript

$ php bin/vm.php test/repro/issue_23074_curlhandle_serialize_deny.php
Exception:Serialization of 'CurlHandle' is not allowed
Exception:Unserialization of 'CurlHandle' is not allowed

$ php bin/jit.php test/repro/issue_23074_curlhandle_serialize_deny.php
Exception:Serialization of 'CurlHandle' is not allowed
Exception:Unserialization of 'CurlHandle' is not allowed

$ ./script/phpunit.sh --filter 'curl_handle_serialize_disallowed|curl_multi_share_serialize_disallowed'
OK (4 tests, 4 assertions)

Made with Cursor

Extend CurlFileSerializeDeny (post-#23064) so curl handle objects throw
the same Exception as php-src @not-serializable stubs on serialize/unserialize.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: CurlHandle serialize() allowed — Zend Exception "not allowed" (ext/curl/interface.c)

1 participant