php-src/ext/soap
Niels Dossche c283c3ab0b Sanitize libxml2 globals before parsing
Fixes GHSA-3qrf-m4j2-pcrr.

To parse a document with libxml2, you first need to create a parsing context.
The parsing context contains parsing options (e.g. XML_NOENT to substitute
entities) that the application (in this case PHP) can set.
Unfortunately, libxml2 also supports providing default set options.
For example, if you call xmlSubstituteEntitiesDefault(1) then the XML_NOENT
option will be added to the parsing options every time you create a parsing
context **even if the application never requested XML_NOENT**.

Third party extensions can override these globals, in particular the
substitute entity global. This causes entity substitution to be
unexpectedly active.

Fix it by setting the parsing options to a sane known value.
For API calls that depend on global state we introduce
PHP_LIBXML_SANITIZE_GLOBALS() and PHP_LIBXML_RESTORE_GLOBALS().
For other APIs that work directly with a context we introduce
php_libxml_sanitize_parse_ctxt_options().
2023-07-31 19:47:19 +01:00
..
tests Fix GH-9720: Null pointer dereference while serializing the response 2022-10-13 15:56:08 +02:00
config.m4 Normalize comments in *nix build system m4 files 2019-05-12 18:43:03 +02:00
config.w32
CREDITS
php_encoding.c Merge branch 'PHP-7.4' into PHP-8.0 2021-03-29 14:19:39 +02:00
php_encoding.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_http.c Fix wrong backporting of previous soap patch 2023-06-06 18:49:32 -04:00
php_http.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_packet_soap.c Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_packet_soap.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_schema.c Merge branch 'PHP-7.4' 2020-09-30 08:37:43 +03:00
php_schema.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_sdl.c Fix GH-8538: SoapClient may strip parts of nmtokens 2022-05-23 16:49:12 +02:00
php_sdl.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
php_soap.h Fix [-Wundef] warning in SOAP extension 2020-05-20 16:29:51 +02:00
php_xml.c Sanitize libxml2 globals before parsing 2023-07-31 19:47:19 +01:00
php_xml.h Remove mention of PHP major version in Copyright headers 2019-09-25 14:51:43 +02:00
soap.c Fix GH-9720: Null pointer dereference while serializing the response 2022-10-13 15:56:08 +02:00
soap.stub.php Accept null $location in SoapClient::__setLocation() 2021-02-10 10:50:42 +01:00
soap_arginfo.h Regenerate arginfo file 2021-02-10 11:18:06 +01:00