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

This commit is contained in:
Mira Weller
2026-09-29 13:40:18 +02:00
committed by Raphael Michel
parent d8fe665798
commit 81e004e6c8
2 changed files with 47 additions and 0 deletions
+8
View File
@@ -251,6 +251,13 @@ def monkeypatch_reportlab_imagereader():
utils.ImageReader.__init__ = new_init
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()
@@ -258,3 +265,4 @@ def monkeypatch_all_at_ready():
monkeypatch_urllib3_ssrf_protection()
monkeypatch_cookie_morsel()
monkeypatch_reportlab_imagereader()
monkeypatch_json_constants()