CVE-2024-41989: Denial-Of-Service vulnerability in the floatformat template filter when input string contains a big exponent in scientific notation
The floatformat template filter in Django consumes excessive memory when given a string in scientific notation with a large exponent. An attacker could cause a denial of service by exhausting server memory.
- Triaged in 6 days
- Fixed in 16 days
- Paid in 16 days
- Disclosed after 47 days
Summary by the program
CVE-2024-41989: Memory exhaustion in django.utils.numberformat.floatformat() The floatformat template filter is subject to significant memory consumption when given a string representation of a number in scientific notation with a large exponent.
Thanks to Elias Myllymäki for the report.
This issue has severity "moderate" according to the Django security policy.
Full Security Advisory: https://www.djangoproject.com/weblog/2024/aug/06/security-releases/
The report
This vulnerability exists in the floatformat input filter when an attacker can pass a string with an "e" character in it to the input filter. This vulnerability takes advantage of the way strings with scientific exponents are converted internally to integers.
Impact
An attacker can cause uncontrolled memory and resource consumption on a vulnerable django server.
(I have attached a screenrecording of the email conversation, the original email as an EML file, the original attachment as a zip file, a screenrecording of the entire email convo, the entire convo as a pdf file and a screenshot from the email convo. My personal email address is ███████ feel free to contact me directly if you have any questions.)
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the filter converts the exponent to an integer and then attempts to create a string of that length, leading to memory exhaustion.
Impact
An attacker could cause uncontrolled memory and resource consumption on a vulnerable Django server, potentially leading to a denial of service.
What the attacker needed
Ability to pass a string to floatformat filter
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A template filter formats data in web pages. Here, a number written with a very large exponent makes the filter use a huge amount of memory, which can make the server slow or crash, denying service to legitimate users.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.