Subject: | Malformed input crashes server |
Hi
When sending malformed/unclosed namespaces the server simply chrashes.
Tested under 62bit and 32bit, Debian GNU/Linux 8.0 and Ubuntu 14.04.1
with Perl v5.18.2 and v5.20.1
Here's my server example and custom client for testing. You can play around with the namespaces.
Subject: | crash_rpc_server.pl |
#!/usr/bin/env perl
use IO::Socket::INET;
$msg =<<'EOF';
<?xml version="1.0" encoding="us-ascii"?>
<methodCall>
<methodName>chrash.this by a simple < </methodName>
<params>
<param><value><string>Malformed string</string></value></param>
</params>
</methodCall>
EOF
$socket = new IO::Socket::INET(PeerAddr => '127.0.0.1',
PeerPort => 8001,
Type => SOCK_STREAM,
Proto => 'tcp') || die $!;
print $socket "POST / HTTP/1.0\r\n";
print $socket "Accept-Encoding: deflate\r\n";
print $socket "Host: 127.0.0.1:8001\r\n";
print $socket "User-Agent: RPC::XML::Client/1.42 libwww-perl/6.08\r\n";
print $socket "Content-Length: " , length $msg , "\r\n";
print $socket "Content-Type: text/xml\r\n\n";
print $socket $msg;
Subject: | simple_rpc_server.pl |
#!/usr/bin/env perl
use RPC::XML;
use RPC::XML::Server;
$daemon = RPC::XML::Server->new(host => '127.0.0.1',
port => 8001
);
$daemon->add_method({
name => 'chrash.this',
signature => ['string'],
code => \&chrash_this
});
$daemon->server_loop();
sub chrash_this {
return "foobar";
}