VYPR
High severityOSV Advisory· Published Feb 11, 2019· Updated Aug 4, 2024

CVE-2019-6975

CVE-2019-6975

Description

Django 1.11.x before 1.11.19, 2.0.x before 2.0.11, and 2.1.x before 2.1.6 allows Uncontrolled Memory Consumption via a malicious attacker-supplied value to the django.utils.numberformat.format() function.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Django versions before 1.11.19, 2.0.11, and 2.1.6 allow denial of service via uncontrolled memory consumption in the numberformat.format() function.

Vulnerability

Django versions 1.11.x before 1.11.19, 2.0.x before 2.0.11, and 2.1.x before 2.1.6 contain a flaw in the django.utils.numberformat.format() function that allows uncontrolled memory consumption when processing a maliciously crafted value [2][4]. The function does not properly limit resource allocation, leading to excessive memory usage.

Exploitation

An attacker can exploit this vulnerability by providing a specially crafted value to any application endpoint that uses the format() function from django.utils.numberformat. No authentication is required if the endpoint is publicly accessible; the attacker only needs the ability to supply input to the vulnerable function [2][3].

Impact

Successful exploitation results in uncontrolled memory consumption, causing a denial of service (DoS) condition. The application may become unresponsive or crash due to memory exhaustion [2][3].

Mitigation

The issue is fixed in Django 1.11.19, 2.0.11, and 2.1.6 [3]. Users should upgrade to these or later versions. No workaround is available; upgrading is the recommended mitigation [3].

AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
DjangoPyPI
>= 1.11, < 1.11.191.11.19
DjangoPyPI
>= 2.0, < 2.0.112.0.11
DjangoPyPI
>= 2.1, < 2.1.62.1.6

Affected products

354

Patches

6
1cdba624d55d

[1.11.x] Bumped version for 1.11.19 release.

https://github.com/django/djangoCarlton GibsonFeb 11, 2019via osv
1 file changed · +1 1
  • django/__init__.py+1 1 modified
    @@ -2,7 +2,7 @@
     
     from django.utils.version import get_version
     
    -VERSION = (1, 11, 19, 'alpha', 0)
    +VERSION = (1, 11, 19, 'final', 0)
     
     __version__ = get_version(VERSION)
     
    
be439e58768c

[2.0.x] Bumped version for 2.0.11 release.

https://github.com/django/djangoCarlton GibsonFeb 11, 2019via osv
1 file changed · +1 1
  • django/__init__.py+1 1 modified
    @@ -1,6 +1,6 @@
     from django.utils.version import get_version
     
    -VERSION = (2, 0, 11, 'alpha', 0)
    +VERSION = (2, 0, 11, 'final', 0)
     
     __version__ = get_version(VERSION)
     
    
79a6e7798fec

[2.1.x] Bumped version for 2.1.6 release.

https://github.com/django/djangoCarlton GibsonFeb 11, 2019via osv
1 file changed · +1 1
  • django/__init__.py+1 1 modified
    @@ -1,6 +1,6 @@
     from django.utils.version import get_version
     
    -VERSION = (2, 1, 6, 'alpha', 0)
    +VERSION = (2, 1, 6, 'final', 0)
     
     __version__ = get_version(VERSION)
     
    
0bbb560183fa

[1.11.x] Fixed CVE-2019-6975 -- Fixed memory exhaustion in utils.numberformat.format().

https://github.com/django/djangoCarlton GibsonFeb 11, 2019via ghsa
3 files changed · +44 1
  • django/utils/numberformat.py+14 1 modified
    @@ -30,7 +30,20 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
         # sign
         sign = ''
         if isinstance(number, Decimal):
    -        str_number = '{:f}'.format(number)
    +        # Format values with more than 200 digits (an arbitrary cutoff) using
    +        # scientific notation to avoid high memory usage in {:f}'.format().
    +        _, digits, exponent = number.as_tuple()
    +        if abs(exponent) + len(digits) > 200:
    +            number = '{:e}'.format(number)
    +            coefficient, exponent = number.split('e')
    +            # Format the coefficient.
    +            coefficient = format(
    +                coefficient, decimal_sep, decimal_pos, grouping,
    +                thousand_sep, force_grouping,
    +            )
    +            return '{}e{}'.format(coefficient, exponent)
    +        else:
    +            str_number = '{:f}'.format(number)
         else:
             str_number = six.text_type(number)
         if str_number[0] == '-':
    
  • docs/releases/1.11.19.txt+12 0 modified
    @@ -5,3 +5,15 @@ Django 1.11.19 release notes
     *February 11, 2019*
     
     Django 1.11.19 fixes a security issue in 1.11.18.
    +
    +CVE-2019-6975: Memory exhaustion in ``django.utils.numberformat.format()``
    +--------------------------------------------------------------------------
    +
    +If ``django.utils.numberformat.format()`` -- used by ``contrib.admin`` as well
    +as the the ``floatformat``, ``filesizeformat``, and ``intcomma`` templates
    +filters -- received a ``Decimal`` with a large number of digits or a large
    +exponent, it could lead to significant memory usage due to a call to
    +``'{:f}'.format()``.
    +
    +To avoid this, decimals with more than 200 digits are now formatted using
    +scientific notation.
    
  • tests/utils_tests/test_numberformat.py+18 0 modified
    @@ -60,6 +60,24 @@ def test_decimal_numbers(self):
             self.assertEqual(nformat(Decimal('1234'), '.', grouping=2, thousand_sep=',', force_grouping=True), '12,34')
             self.assertEqual(nformat(Decimal('-1234.33'), '.', decimal_pos=1), '-1234.3')
             self.assertEqual(nformat(Decimal('0.00000001'), '.', decimal_pos=8), '0.00000001')
    +        # Very large & small numbers.
    +        tests = [
    +            ('9e9999', None, '9e+9999'),
    +            ('9e9999', 3, '9.000e+9999'),
    +            ('9e201', None, '9e+201'),
    +            ('9e200', None, '9e+200'),
    +            ('1.2345e999', 2, '1.23e+999'),
    +            ('9e-999', None, '9e-999'),
    +            ('1e-7', 8, '0.00000010'),
    +            ('1e-8', 8, '0.00000001'),
    +            ('1e-9', 8, '0.00000000'),
    +            ('1e-10', 8, '0.00000000'),
    +            ('1e-11', 8, '0.00000000'),
    +            ('1' + ('0' * 300), 3, '1.000e+300'),
    +            ('0.{}1234'.format('0' * 299), 3, '1.234e-300'),
    +        ]
    +        for value, decimal_pos, expected_value in tests:
    +            self.assertEqual(nformat(Decimal(value), '.', decimal_pos), expected_value)
     
         def test_decimal_subclass(self):
             class EuroDecimal(Decimal):
    
1f42f82566c9

[2.0.x] Fixed CVE-2019-6975 -- Fixed memory exhaustion in utils.numberformat.format().

https://github.com/django/djangoCarlton GibsonFeb 11, 2019via ghsa
4 files changed · +57 1
  • django/utils/numberformat.py+14 1 modified
    @@ -27,7 +27,20 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
         # sign
         sign = ''
         if isinstance(number, Decimal):
    -        str_number = '{:f}'.format(number)
    +        # Format values with more than 200 digits (an arbitrary cutoff) using
    +        # scientific notation to avoid high memory usage in {:f}'.format().
    +        _, digits, exponent = number.as_tuple()
    +        if abs(exponent) + len(digits) > 200:
    +            number = '{:e}'.format(number)
    +            coefficient, exponent = number.split('e')
    +            # Format the coefficient.
    +            coefficient = format(
    +                coefficient, decimal_sep, decimal_pos, grouping,
    +                thousand_sep, force_grouping, use_l10n,
    +            )
    +            return '{}e{}'.format(coefficient, exponent)
    +        else:
    +            str_number = '{:f}'.format(number)
         else:
             str_number = str(number)
         if str_number[0] == '-':
    
  • docs/releases/1.11.19.txt+12 0 modified
    @@ -5,3 +5,15 @@ Django 1.11.19 release notes
     *February 11, 2019*
     
     Django 1.11.19 fixes a security issue in 1.11.18.
    +
    +CVE-2019-6975: Memory exhaustion in ``django.utils.numberformat.format()``
    +--------------------------------------------------------------------------
    +
    +If ``django.utils.numberformat.format()`` -- used by ``contrib.admin`` as well
    +as the the ``floatformat``, ``filesizeformat``, and ``intcomma`` templates
    +filters -- received a ``Decimal`` with a large number of digits or a large
    +exponent, it could lead to significant memory usage due to a call to
    +``'{:f}'.format()``.
    +
    +To avoid this, decimals with more than 200 digits are now formatted using
    +scientific notation.
    
  • docs/releases/2.0.11.txt+12 0 modified
    @@ -5,3 +5,15 @@ Django 2.0.11 release notes
     *February 11, 2019*
     
     Django 2.0.11 fixes a security issue in 2.0.10.
    +
    +CVE-2019-6975: Memory exhaustion in ``django.utils.numberformat.format()``
    +--------------------------------------------------------------------------
    +
    +If ``django.utils.numberformat.format()`` -- used by ``contrib.admin`` as well
    +as the the ``floatformat``, ``filesizeformat``, and ``intcomma`` templates
    +filters -- received a ``Decimal`` with a large number of digits or a large
    +exponent, it could lead to significant memory usage due to a call to
    +``'{:f}'.format()``.
    +
    +To avoid this, decimals with more than 200 digits are now formatted using
    +scientific notation.
    
  • tests/utils_tests/test_numberformat.py+19 0 modified
    @@ -75,6 +75,25 @@ def test_decimal_numbers(self):
             )
             self.assertEqual(nformat(Decimal('3.'), '.'), '3')
             self.assertEqual(nformat(Decimal('3.0'), '.'), '3.0')
    +        # Very large & small numbers.
    +        tests = [
    +            ('9e9999', None, '9e+9999'),
    +            ('9e9999', 3, '9.000e+9999'),
    +            ('9e201', None, '9e+201'),
    +            ('9e200', None, '9e+200'),
    +            ('1.2345e999', 2, '1.23e+999'),
    +            ('9e-999', None, '9e-999'),
    +            ('1e-7', 8, '0.00000010'),
    +            ('1e-8', 8, '0.00000001'),
    +            ('1e-9', 8, '0.00000000'),
    +            ('1e-10', 8, '0.00000000'),
    +            ('1e-11', 8, '0.00000000'),
    +            ('1' + ('0' * 300), 3, '1.000e+300'),
    +            ('0.{}1234'.format('0' * 299), 3, '1.234e-300'),
    +        ]
    +        for value, decimal_pos, expected_value in tests:
    +            with self.subTest(value=value):
    +                self.assertEqual(nformat(Decimal(value), '.', decimal_pos), expected_value)
     
         def test_decimal_subclass(self):
             class EuroDecimal(Decimal):
    
40cd19055773

[2.1.x] Fixed CVE-2019-6975 -- Fixed memory exhaustion in utils.numberformat.format().

https://github.com/django/djangoCarlton GibsonFeb 11, 2019via ghsa
5 files changed · +69 1
  • django/utils/numberformat.py+14 1 modified
    @@ -27,7 +27,20 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
         # sign
         sign = ''
         if isinstance(number, Decimal):
    -        str_number = '{:f}'.format(number)
    +        # Format values with more than 200 digits (an arbitrary cutoff) using
    +        # scientific notation to avoid high memory usage in {:f}'.format().
    +        _, digits, exponent = number.as_tuple()
    +        if abs(exponent) + len(digits) > 200:
    +            number = '{:e}'.format(number)
    +            coefficient, exponent = number.split('e')
    +            # Format the coefficient.
    +            coefficient = format(
    +                coefficient, decimal_sep, decimal_pos, grouping,
    +                thousand_sep, force_grouping, use_l10n,
    +            )
    +            return '{}e{}'.format(coefficient, exponent)
    +        else:
    +            str_number = '{:f}'.format(number)
         else:
             str_number = str(number)
         if str_number[0] == '-':
    
  • docs/releases/1.11.19.txt+12 0 modified
    @@ -5,3 +5,15 @@ Django 1.11.19 release notes
     *February 11, 2019*
     
     Django 1.11.19 fixes a security issue in 1.11.18.
    +
    +CVE-2019-6975: Memory exhaustion in ``django.utils.numberformat.format()``
    +--------------------------------------------------------------------------
    +
    +If ``django.utils.numberformat.format()`` -- used by ``contrib.admin`` as well
    +as the the ``floatformat``, ``filesizeformat``, and ``intcomma`` templates
    +filters -- received a ``Decimal`` with a large number of digits or a large
    +exponent, it could lead to significant memory usage due to a call to
    +``'{:f}'.format()``.
    +
    +To avoid this, decimals with more than 200 digits are now formatted using
    +scientific notation.
    
  • docs/releases/2.0.11.txt+12 0 modified
    @@ -5,3 +5,15 @@ Django 2.0.11 release notes
     *February 11, 2019*
     
     Django 2.0.11 fixes a security issue in 2.0.10.
    +
    +CVE-2019-6975: Memory exhaustion in ``django.utils.numberformat.format()``
    +--------------------------------------------------------------------------
    +
    +If ``django.utils.numberformat.format()`` -- used by ``contrib.admin`` as well
    +as the the ``floatformat``, ``filesizeformat``, and ``intcomma`` templates
    +filters -- received a ``Decimal`` with a large number of digits or a large
    +exponent, it could lead to significant memory usage due to a call to
    +``'{:f}'.format()``.
    +
    +To avoid this, decimals with more than 200 digits are now formatted using
    +scientific notation.
    
  • docs/releases/2.1.6.txt+12 0 modified
    @@ -6,6 +6,18 @@ Django 2.1.6 release notes
     
     Django 2.1.6 fixes a security issue and a bug in 2.1.5.
     
    +CVE-2019-6975: Memory exhaustion in ``django.utils.numberformat.format()``
    +--------------------------------------------------------------------------
    +
    +If ``django.utils.numberformat.format()`` -- used by ``contrib.admin`` as well
    +as the the ``floatformat``, ``filesizeformat``, and ``intcomma`` templates
    +filters -- received a ``Decimal`` with a large number of digits or a large
    +exponent, it could lead to significant memory usage due to a call to
    +``'{:f}'.format()``.
    +
    +To avoid this, decimals with more than 200 digits are now formatted using
    +scientific notation.
    +
     Bugfixes
     ========
     
    
  • tests/utils_tests/test_numberformat.py+19 0 modified
    @@ -80,6 +80,25 @@ def test_decimal_numbers(self):
             )
             self.assertEqual(nformat(Decimal('3.'), '.'), '3')
             self.assertEqual(nformat(Decimal('3.0'), '.'), '3.0')
    +        # Very large & small numbers.
    +        tests = [
    +            ('9e9999', None, '9e+9999'),
    +            ('9e9999', 3, '9.000e+9999'),
    +            ('9e201', None, '9e+201'),
    +            ('9e200', None, '9e+200'),
    +            ('1.2345e999', 2, '1.23e+999'),
    +            ('9e-999', None, '9e-999'),
    +            ('1e-7', 8, '0.00000010'),
    +            ('1e-8', 8, '0.00000001'),
    +            ('1e-9', 8, '0.00000000'),
    +            ('1e-10', 8, '0.00000000'),
    +            ('1e-11', 8, '0.00000000'),
    +            ('1' + ('0' * 300), 3, '1.000e+300'),
    +            ('0.{}1234'.format('0' * 299), 3, '1.234e-300'),
    +        ]
    +        for value, decimal_pos, expected_value in tests:
    +            with self.subTest(value=value):
    +                self.assertEqual(nformat(Decimal(value), '.', decimal_pos), expected_value)
     
         def test_decimal_subclass(self):
             class EuroDecimal(Decimal):
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

23

News mentions

0

No linked articles in our index yet.