Skip to content

Commit 4e67dfd

Browse files
committed
gh-148954: sanitize methodname in xmlrpc.client.dumps() to prevent XML injection
1 parent 618b726 commit 4e67dfd

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/xmlrpc/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None,
965965
data = (
966966
xmlheader,
967967
"<methodCall>\n"
968-
"<methodName>", methodname, "</methodName>\n",
968+
"<methodName>", escape(methodname), "</methodName>\n",
969969
data,
970970
"</methodCall>\n"
971971
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix XML injection vulnerability in :func:`xmlrpc.client.dumps` where the ``methodname``
2+
was not being escaped before interpolation into the XML body.

0 commit comments

Comments
 (0)