[Bug #1473048]
commitd714024bfb38104b2447d652b92aa001318edb59
authorandrew.kuchling <andrew.kuchling@6015fed2-1504-0410-9fe1-9d1591cc4771>
Wed, 31 May 2006 14:08:48 +0000 (31 14:08 +0000)
committerandrew.kuchling <andrew.kuchling@6015fed2-1504-0410-9fe1-9d1591cc4771>
Wed, 31 May 2006 14:08:48 +0000 (31 14:08 +0000)
tree44897b8a64d6f03c1796c4fb3f17b9dfecf1bf4d
parente5442c6955b689ed5a3d7f21b1e01b0357f6992d
[Bug #1473048]
SimpleXMLRPCServer and DocXMLRPCServer don't look at
the path of the HTTP request at all; you can POST or
GET from / or /RPC2 or /blahblahblah with the same results.
Security scanners that look for /cgi-bin/phf will therefore report
lots of vulnerabilities.

Fix: add a .rpc_paths attribute to the SimpleXMLRPCServer class,
and report a 404 error if the path isn't on the allowed list.

Possibly-controversial aspect of this change: the default makes only
'/' and '/RPC2' legal.  Maybe this will break people's applications
(though I doubt it).  We could just set the default to an empty tuple,
which would exactly match the current behaviour.

git-svn-id: http://svn.python.org/projects/python/trunk@46578 6015fed2-1504-0410-9fe1-9d1591cc4771
Doc/lib/libsimplexmlrpc.tex
Lib/DocXMLRPCServer.py
Lib/SimpleXMLRPCServer.py