From 07b6fc93b11b46926db6e7c02f90c84981a40c33 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 21 Feb 2016 23:45:57 -0800 Subject: [PATCH] Fix bug #71610: Type Confusion Vulnerability - SOAP / make_http_soap_request() --- ext/soap/php_http.c | 2 ++ ext/soap/tests/bug71610.phpt | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 ext/soap/tests/bug71610.phpt diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 2baa0fa3ff..a2d0b6207d 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -833,8 +833,10 @@ try_again: Z_TYPE_P(value) == IS_STRING) { zval *tmp; if (((tmp = zend_hash_index_find(Z_ARRVAL_P(data), 1)) == NULL || + Z_TYPE_P(tmp) != IS_STRING || strncmp(phpurl->path?phpurl->path:"/",Z_STRVAL_P(tmp),Z_STRLEN_P(tmp)) == 0) && ((tmp = zend_hash_index_find(Z_ARRVAL_P(data), 2)) == NULL || + Z_TYPE_P(tmp) != IS_STRING || in_domain(phpurl->host,Z_STRVAL_P(tmp))) && (use_ssl || (tmp = zend_hash_index_find(Z_ARRVAL_P(data), 3)) == NULL)) { smart_str_append(&soap_headers, key); diff --git a/ext/soap/tests/bug71610.phpt b/ext/soap/tests/bug71610.phpt new file mode 100644 index 0000000000..4f1c7162ff --- /dev/null +++ b/ext/soap/tests/bug71610.phpt @@ -0,0 +1,15 @@ +--TEST-- +SOAP Bug #71610 - Type Confusion Vulnerability - SOAP / make_http_soap_request() +--SKIPIF-- + +--FILE-- +blahblah(); +} catch(SoapFault $e) { + echo $e->getMessage()."\n"; +} +?> +--EXPECT-- +looks like we got no XML document -- 2.40.0