Prevent parsing non-standard-compliant JSON float values (Z#23245937 / PRT-021)

This commit is contained in:
Mira Weller
2026-09-29 14:30:54 +02:00
committed by Raphael Michel
parent 9c0fef3d72
commit d78d5b52fa
2 changed files with 48 additions and 0 deletions
+9
View File
@@ -251,6 +251,13 @@ def monkeypatch_csrf_middleware():
BaseCsrfMiddleware._set_csrf_cookie = CsrfViewMiddleware._set_csrf_cookie
def monkeypatch_json_constants():
from json.decoder import _CONSTANTS # noqa
del _CONSTANTS['-Infinity']
del _CONSTANTS['Infinity']
del _CONSTANTS['NaN']
def monkeypatch_all_at_ready():
monkeypatch_vobject_performance()
monkeypatch_pillow_safer()
@@ -259,3 +266,5 @@ def monkeypatch_all_at_ready():
monkeypatch_cookie_morsel()
monkeypatch_reportlab_imagereader()
monkeypatch_csrf_middleware()
monkeypatch_json_constants()