You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document the security of tomllib for untrusted input #111264
Warning
Be cautious when parsing JSON data from untrusted sources. A malicious JSON string may cause
the decoder to consume considerable CPU and memory resources. Limiting the size of data to be parsed is
recommended.
Let's add a similar note. Perhaps not as a warning -- it's more about communicating what to worry about when dealing with untrusted data (it might make the fan spin but won't format your disk), but also a reminder that you should think about how trusted your data is, plus a basic precaution.
Activity
hukkin commentedon Oct 10, 2024
In PR #96499
jsondocs added the warningas response to CVE-2020-10735 (cpython issue #95778).
The countermeasures already exist in v3.11.0 where
tomllibfirst appears so it's not vulnerable to that particular threat at least.encukou commentedon Mar 20, 2026
Let's add a similar note. Perhaps not as a warning -- it's more about communicating what to worry about when dealing with untrusted data (it might make the fan spin but won't format your disk), but also a reminder that you should think about how trusted your data is, plus a basic precaution.
pythongh-111264: Add a note about untrusted input to tomllib docs
gh-111264: Add a note about untrusted input to tomllib docs (GH-146209)
[3.14] gh-111264: Add a note about untrusted input to tomllib docs (G…
[3.13] gh-111264: Add a note about untrusted input to tomllib docs (#…