Skip to content

Handle bad xmlrpc data with BadRequest #1244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst
5.11.2 (unreleased)
-------------------

- Fix error messages from spam/pen test requests.

- Fix a ``ResourceWarning`` emitted when uploading large files.
(`#1242 <https://github.com/zopefoundation/Zope/issues/1242>`_)

Expand All @@ -24,6 +26,7 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst

- Update to ``zope.interface = 7.2``.


5.11.1 (2024-11-03)
-------------------

Expand Down
6 changes: 5 additions & 1 deletion src/ZPublisher/HTTPRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from urllib.parse import parse_qsl
from urllib.parse import unquote
from urllib.parse import urlparse
from xmlrpc.client import ResponseError

from AccessControl.tainted import should_be_tainted as base_should_be_tainted
from AccessControl.tainted import taint_string
Expand Down Expand Up @@ -872,7 +873,10 @@ def processInputs(
if meth is not None:
raise BadRequest('method directive not supported for '
'xmlrpc request')
meth, self.args = xmlrpc.parse_input(fs.value)
try:
meth, self.args = xmlrpc.parse_input(fs.value)
except ResponseError as e:
raise BadRequest(e)
response = xmlrpc.response(response)
other['RESPONSE'] = self.response = response
self.maybe_webdav_client = 0
Expand Down
Loading