alorence / django-modern-rpc

Simple XML-RPC and JSON-RPC server for modern Django
http://django-modern-rpc.rtfd.io
MIT License
98 stars 17 forks source link

Improve security by using defusedxml when installed in environment #65

Closed alorence closed 8 months ago

alorence commented 8 months ago

This change was originally suggested by @atodorov, thanks to him for this contribution.

Currently, django-modern-rpc uses builtin xmlrpc.client.loads() function to parse incoming requests. But this can cause a security issue when an attacker send a valid but malicious XML-RPC request.

A Python package can help to mitigate this kind of attack, defusedxml (GitHub repo).

The goal of this PR is to implement defusedxml support in django-modern-rpc

Currently:

Remaining

Drawbacks

coveralls commented 8 months ago

Pull Request Test Coverage Report for Build 8080878481

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
modernrpc/apps.py 6 10 60.0%
<!-- Total: 6 10 60.0% -->
Totals Coverage Status
Change from base Build 8065652169: -0.5%
Covered Lines: 737
Relevant Lines: 752

💛 - Coveralls
alorence commented 8 months ago

Thanks @atodorov for your feedbacks. I just implemented some of them, and renamed a few things. Some documentations and comments were also added. In addition, I updated the way tests are run around this change, and I dropped the need to define a custom live_server fixture. So basically, we do not need to drop Django 2.1 support anymore...