com php-src: Fix bug #71610: Type Confusion Vulnerability - SOAP / make_http_soap_request(): ext/soap/php_http.c ext/soap/tests/bug71610.phpt
| From: | Stanislav Malyshev | Date: | Mon, 22 Feb 2016 07:45:57 +0000 |
| Subject: | com php-src: Fix bug #71610: Type Confusion Vulnerability - SOAP / make_http_soap_request(): ext/soap/php_http.c ext/soap/tests/bug71610.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91242@lists.php.net to get a copy of this message | ||
Commit: eaf4e77190d402ea014207e9a7d5da1a4f3727ba
Author: Stanislav Malyshev <stas@php.net> Sun, 21 Feb 2016 23:45:57 -0800
Parents: 57b997ebf99e0eb9a073e0dafd2ab100bd4a112d
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=eaf4e77190d402ea014207e9a7d5da1a4f3727ba
Log:
Fix bug #71610: Type Confusion Vulnerability - SOAP / make_http_soap_request()
Bugs:
https://bugs.php.net/71610
Changed paths:
M ext/soap/php_http.c
A ext/soap/tests/bug71610.phpt
Diff:
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 2baa0fa..a2d0b62 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 0000000..4f1c716
--- /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--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$exploit =
unserialize('O:10:"SoapClient":3:{s:3:"uri";s:1:"a";s:8:"location";s:19:"http://testuri.org/";s:8:"_cookies";a:1:{s:8:"manhluat";a:3:{i:0;s:0:"";i:1;N;i:2;N;}}}}');
+try {
+$exploit->blahblah();
+} catch(SoapFault $e) {
+ echo $e->getMessage()."\n";
+}
+?>
+--EXPECT--
+looks like we got no XML document