carltongibson/django-filter · Security
Potential DoS with NumberFilter conversion to integer values.
- GHSA ID
- GHSA-x7gm-rfgv-w973
- CVE ID
- CVE-2020-15225
- Severity
- high
- Published
- Updated
- CVSS
- 7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CVSS v3
- 7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CVSS v4
- 8.7 · CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Description
Impact
Automatically generated NumberFilter instances, whose value was later converted to an integer, were subject to potential DoS from maliciously input using exponential format with sufficiently large exponents.
Patches
Version 2.4.0+ applies a MaxValueValidator with a a default limit_value of 1e50 to the form field used by NumberFilter instances.
In addition, NumberFilter implements the new get_max_validator() which should return a configured validator instance to customise the limit, or else None to disable the additional validation.
Workarounds
Users may manually apply an equivalent validator if they are not able to upgrade.
For more information
If you have any questions or comments about this advisory:
- Open an issue in the django-filter repo
Thanks to Marcin Waraksa for the report.
CWEs
- CWE-681 · Incorrect Conversion between Numeric Types
References
- https://github.com/carltongibson/django-filter/security/advisories/GHSA-x7gm-rfgv-w973 ↗
- https://github.com/carltongibson/django-filter/commit/340cf7a23a2b3dcd7183f6a0d6c383e85b130d2b ↗
- https://github.com/carltongibson/django-filter/releases/tag/2.4.0 ↗
- https://nvd.nist.gov/vuln/detail/CVE-2020-15225 ↗
- https://github.com/pypa/advisory-database/tree/main/vulns/django-filter/PYSEC-2021-64.yaml ↗
- https://lists.fedoraproject.org/archives/list/[email protected]/message/DPHENTRHRAYFXYPPBT7JRHZRWILRY44S ↗
- https://lists.fedoraproject.org/archives/list/[email protected]/message/FAT2ZAEF6DM3VFSOHKB7X3ASSHGQHJAK ↗
- https://lists.fedoraproject.org/archives/list/[email protected]/message/SVJ7AYU6FUSU3F653YCGW5LFD3IULRSX ↗
- https://pypi.org/project/django-filter ↗
- https://security.netapp.com/advisory/ntap-20210604-0010 ↗
- https://github.com/advisories/GHSA-x7gm-rfgv-w973 ↗