-
- Downloads
[FIX] core: avoid feeding client invalid XML-RPC documents
The XML-RPC interface has a compatibility shim for binaries as
historically Odoo has returned "binary" data as base64 strings. To
avoid breakages during the Python 3 transition, the shim was
introduced to decode the output binary data (under the assumption that
it'd be ASCII-compatible).
In the case where the data is *not* ascii-compatible, however, it can
generate invalid XML documents: "C0" control codes (with the exception
of tab, LF, and CR) are not valid in XML 1.0 (which XML-RPC is an
application of), however they're perfectly valid string characters and
the standard library's marshaller does not check for them, embedding
them directly in the output document and breaking the client's
decoding.
Work around the issue by replacing such binary data with an empty
string.
While at it, move the bytes shim to the customized marshaller, this
way everything's at the same place and it's not necessary to waste
time trying to understand why the marshaller is just not calling what
it's supposed to call.
Fixes #61919
closes odoo/odoo#74699
Signed-off-by:
Xavier Morel (xmo) <xmo@odoo.com>
Showing
- odoo/addons/base/controllers/rpc.py 21 additions, 8 deletionsodoo/addons/base/controllers/rpc.py
- odoo/addons/base/tests/test_xmlrpc.py 8 additions, 0 deletionsodoo/addons/base/tests/test_xmlrpc.py
- odoo/service/server.py 0 additions, 1 deletionodoo/service/server.py
- odoo/service/wsgi_server.py 0 additions, 11 deletionsodoo/service/wsgi_server.py
Please register or sign in to comment