xref: /PHP-8.2/ext/soap/tests/bug70388.phpt (revision adb45a63)
1--TEST--
2Bug #70388 (SOAP serialize_function_call() type confusion / RCE)
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7
8#[AllowDynamicProperties]
9class MySoapClient extends SoapClient {
10    public function __doRequest($request, $location, $action, $version, $one_way = 0): string {
11        echo $request, "\n";
12        return '';
13    }
14}
15$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).'";}}');
16$dummy->notexisting();
17?>
18--EXPECT--
19<?xml version="1.0" encoding="UTF-8"?>
20<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>
21