Skip to content

ext/soap: Fix NULL dereference on empty Body with matching SOAPAction - #25661

Closed
jorgsowa wants to merge 2 commits into
php:PHP-8.5from
jorgsowa:fix-soap-empty-body-soapaction
Closed

jorgsowa wants to merge 2 commits into
php:PHP-8.5from
jorgsowa:fix-soap-empty-body-soapaction

Conversation

@jorgsowa

Copy link
Copy Markdown
Contributor

Since #15970 (63e0b9c, fix for #49169), deserialize_function_call() can resolve the function from the SOAPAction header even when the request Body has no function element. The "Body without function call" fault is then skipped, and func (still NULL) is dereferenced via func->children.

Any SoapServer whose WSDL has an RPC-style operation with a soapAction can be crashed by an unauthenticated request with an empty Body and the matching SOAPAction header.

The fix skips descending into the method element when there is none. Operations with parameters get the existing "Missing parameter" fault. Operations without parameters are called.

PHP 8.4 is not affected.

Since 63e0b9c the function can be resolved from the SOAPAction
header when the Body has no function element, leaving func NULL.
@jorgsowa jorgsowa self-assigned this Nov 22, 2026
@jorgsowa
jorgsowa requested a review from devnexen as a code owner November 22, 2026 22:22
@jorgsowa jorgsowa closed this in 19fcd2e Nov 24, 2026
arnaud-lb added a commit to bm1549/php-src that referenced this pull request Nov 24, 2026
* PHP-8.5: (25 commits)
  [skip ci] Add APP_DEBUG=0 for Symfony Preloading test
  streams: fix stale readbuflen after stream_filter_remove() on a read filter
  Update NEWS for phpGH-20920 LibreSSL build fix
  Fix phpGH-20920: do not use OPENSSL_strndup() for peer CN matching
  Simplify php_openssl_load_all_certs_from_file()
  Fix phpGH-20920: only register PKCS7_NO_DUAL_CONTENT when it is defined
  Fix phpGH-20920: guard ENGINE_cleanup() with OPENSSL_NO_ENGINE again
  ext/soap: Fix NULL dereference on empty Body with matching SOAPAction (phpGH-25661)
  ext/dom: Fix use-after-free in getElementById() after removing an ID attribute
  ext/reflection: Don't call destructor when constructor is not public in newInstance(Args)()
  ext/phar: unset() of an entry with an open handle use-after-free.
  ext/intl: Fix IntlCalendar::setTime() build on PHP 8.5 and later
  ext/intl: Reject non-finite timestamps in IntlCalendar::setTime() (php#25668)
  [skip ci] Speed up community build
  [skip ci] Backport test-suite.yml changes from master
  Fix propagation of public(set) of readonly trait property
  Make test accept different outputs
  Fix phpGH-25528: Retain the Phar OpenSSL signing key (php#25529)
  ext/pdo_sqlite: Fix use-after-free of bound string and LOB parameters
  ext/opcache: Fix JIT ASSIGN_DIM undefined OP_DATA and dim reporting on non-array containers (phpGH-24665)
  ...
arnaud-lb added a commit to prateekbhujel/php-src that referenced this pull request Nov 25, 2026
* PHP-8.6: (92 commits)
  Fix arrow functions not capturing variables in partial application args (php#25732)
  Fix float literals losing precision in AST export (phpGH-25461)
  ext/session: don't follow symlinked subdirectories in files GC (phpGH-25671)
  [skip ci] Skip automatic_worker_limit.phpt on few cores
  [skip ci] Fix Symfony test without USE_TRACKED_ALLOC
  [skip ci] Skip assign_dim_undef_op_data_008.phpt when JIT is unavailable
  ext/intl: Preserve the previous MessageFormatter pattern on failure (php#25642)
  Fix phpGH-25313: Assertion !EG(exception) in ZEND_FE_FREE when unpacking a generator into a by-ref parameter throws
  ext/opcache: Fix JIT register allocation for ASSIGN to traced reference
  Fix phpGH-25650: PDO::query() reports wrong argument numbers for ctor args
  Fix tracing JIT taking the wrong branch after a VM interrupt (php#25636)
  [skip ci] Add APP_DEBUG=0 for Symfony Preloading test
  streams: fix stale readbuflen after stream_filter_remove() on a read filter
  Update NEWS for phpGH-20920 LibreSSL build fix
  Fix phpGH-20920: do not use OPENSSL_strndup() for peer CN matching
  Simplify php_openssl_load_all_certs_from_file()
  Fix phpGH-20920: only register PKCS7_NO_DUAL_CONTENT when it is defined
  Fix phpGH-20920: guard ENGINE_cleanup() with OPENSSL_NO_ENGINE again
  ext/soap: Fix NULL dereference on empty Body with matching SOAPAction (phpGH-25661)
  ext/dom: Fix use-after-free in getElementById() after removing an ID attribute
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants