xref: /PHP-8.1/ext/soap/tests/bug70388.phpt (revision f4865010)
1--TEST--
2Bug #70388 (SOAP serialize_function_call() type confusion / RCE)
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7class MySoapClient extends SoapClient {
8    public function __doRequest($request, $location, $action, $version, $one_way = 0): string {
9        echo $request, "\n";
10        return '';
11    }
12}
13$dummy = unserialize('O:12:"MySoapClient":3:{s:3:"uri";s:1:"X";s:8:"location";s:22:"http://localhost/a.xml";s:17:"__default_headers";a:1:{i:1;s:1337:"'.str_repeat("X", 1337).'";}}');
14$dummy->notexisting();
15?>
16--EXPECT--
17<?xml version="1.0" encoding="UTF-8"?>
18<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="X" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns1:notexisting/></SOAP-ENV:Body></SOAP-ENV:Envelope>
19