Skip to content
DoS Disclosed report Intermediate CVE-2024-56374

CVE-2024-56374 Potential denial-of-service in IPv6 validation

Django's IPv6 validation functions lacked an upper bound on input length, so a large malformed string with many colons caused excessive resource consumption and slow processing, leading to a denial-of-service attack. The GenericIPAddressField form field was also vulnerable and has been updated to enforce a maximum length of 39 characters.

0xsaravana Follow

Originally disclosed on HackerOne

  • Fixed in 22 days
  • Paid in 22 days
  • Disclosed after 23 days

Summary by the program

###CVE-2024-56374: Potential denial-of-service vulnerability in IPv6 validation

Lack of upper bound limit enforcement in strings passed when performing IPv6 validation could lead to a potential denial-of-service attack. The undocumented and private functions clean_ipv6_address and is_valid_ipv6_address were vulnerable, as was the django.forms.GenericIPAddressField form field, which has now been updated to define a max_length of 39 characters.

The django.db.models.GenericIPAddressField model field was not affected.

The report

Hi IBB :) in Django i found a potential Dos in IPv6 validation. Due to Lack of upper bound limit enforcement in strings passed in IPv6 validation(is_valid_ipv6_address,clean_ipv6_address methods) ,when a large malformed string with repeatable : characters like, abcd:abcd:abcd:..... is passed that cause huge resource consumption and slower processing which results in denial-of-service attack .

you can see my cve (CVE-2024-56374) with Security Advisory here: https://www.djangoproject.com/weblog/2025/jan/14/security-releases/

Impact

With large malformed string passed for IPv6 validation can perform denial-of-service attack.

The original report as published on HackerOne, by 0xsaravana. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Django is a Python web framework, and the asset in scope here is its GitHub repository. Among the framework's internals are two functions used to validate IPv6 addresses, is_valid_ipv6_address and clean_ipv6_address, plus the form field django.forms.GenericIPAddressField, which accepts user-supplied IP addresses in forms. The model field django.db.models.GenericIPAddressField performs a different kind of validation and, as the advisory states, was not affected.

Validation of an IPv6 address means checking that a string is a well-formed address: the right characters, the right number of groups, and correct use of the : separator and :: compression. The vulnerable functions did this without any upper bound on the length of the string they were given.

Setup

No accounts, roles, tools or versions are described in the report. The researcher worked against the Django codebase and reported the issue through the Internet Bug Bounty program on HackerOne. The report does not describe a specific deployment, request or test harness.

Finding it

The researcher identified that the IPv6 validation routines did not enforce an upper bound on the length of the input string. When a large malformed string containing many repeated : characters, of the form abcd:abcd:abcd:....., is passed to the validation functions, the processing consumes a large amount of resources and becomes slow. That slowdown is what turns the missing length limit into a denial-of-service condition.

The two affected functions named in the report are is_valid_ipv6_address and clean_ipv6_address. The report describes them as undocumented and private functions. The same weakness reached users through django.forms.GenericIPAddressField, which calls into this validation path when a form is submitted.

Exploitation

Step 1: Supply an oversized malformed IPv6 string

The input pattern is a long string built from repeated groups separated by colons, for example:

Text
abcd:abcd:abcd:.....

The important properties are the length of the string and the repeated : separators. The string is malformed as an IPv6 address, but it is still handed to the validation code, which has no limit on how much input it will process.

Step 2: Trigger validation through the form field

Any path that passes attacker-controlled input to is_valid_ipv6_address, clean_ipv6_address or django.forms.GenericIPAddressField will exercise the vulnerable code. The report does not include a request, URL, parameter name or response for this step; it identifies the functions and the form field as the entry points.

Step 3: Observe resource consumption

The result of the oversized input is heavy resource consumption and slower processing. The oversized input causes heavy resource consumption and slower processing, the denial-of-service effect described in the report.

Root cause

The validation routines did not enforce an upper bound on the length of the string they were asked to validate. A valid IPv6 address has a bounded textual length, but the functions enforced no such bound. Without such a check, the code continues to process the whole malformed string, and the cost grows with the input the attacker supplies. The report attributes the issue to this lack of upper bound limit enforcement.

The weakness is classified as allocation of resources without limits or throttling.

Impact

An attacker who can get a large malformed string into IPv6 validation can cause a denial-of-service attack through resource consumption and slow processing. The affected surface is the private validation functions and the django.forms.GenericIPAddressField form field. The django.db.models.GenericIPAddressField model field was not affected, so the exposure depends on whether an application passes user input into the form field or the validation functions. The report does not quantify the size of string needed or the resulting slowdown.

Fix

The report links the Django security advisory for CVE-2024-56374, published with the security releases of 14 January 2025. django.forms.GenericIPAddressField was updated to define a max_length of 39 characters, which limits the length of input accepted by the form field.. The advisory notes that the model field did not need changing.

Variants to test

  • Other validators that accept structured text with separators, such as MAC address, CIDR, hostname or URL parsers. A positive result is processing time that grows with input length well past any legitimate maximum.
  • Form fields that wrap such validators. A positive result is a submitted oversized value that reaches the parser instead of being rejected on length.
  • Private or undocumented helper functions called directly by application code. A positive result is a code path where user input reaches the helper without a length check upstream.

Hunting notes

This kind of bug hides in validation and parsing helpers that assume input is already bounded, especially private functions that application code calls directly and form fields that wrap them. During recon, look for endpoints that accept IP addresses, hostnames or other structured strings and pass them into framework validators. The report establishes impact by naming the exact functions and form field affected, describing the malformed input pattern, and linking the resulting CVE and Django security advisory; it does not include a measured timing or request log.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

Django is a free toolkit for building websites with the Python programming language. Many websites use it behind the scenes to handle forms, databases and the pages you see in your browser. One of the things Django can do is check whether a piece of text looks like a valid IP address, which is the number that identifies a computer on a network.

A security researcher found that two of Django's internal checking routines, and one of its form fields, did not put any limit on how long the text could be before they started checking it. If someone sent a very long, deliberately broken string full of colon characters, the checking code would grind away on the whole thing and use up a lot of the server's resources. Do that enough times and the server becomes too busy to answer normal visitors. That is a denial-of-service attack: not stealing data, just making a service unavailable.

The problem was given the identifier CVE-2024-56374. A CVE is a public catalogue number for a known security flaw, so people can look it up and track the fix. The Django security advisory for CVE-2024-56374 was published with the security releases of 14 January 2025, and the form field now defines a max_length of 39 characters.

Context

Django is a Python web framework. A framework is a collection of ready-made building blocks that developers assemble into a website, so they do not have to write everything from scratch. The asset in scope, meaning the piece of software the bug bounty programme agreed to accept reports about, is Django's GitHub repository. GitHub is a website where source code is stored and shared, and a repository is one project's folder of code and its history.

Inside Django there are two functions used to validate IPv6 addresses: is_valid_ipv6_address and clean_ipv6_address. A function is a named block of code that does one job and can be called from elsewhere. Validation means checking that something is correct or acceptable before the program relies on it. IPv6 is the newer version of the addressing system that gives every device on a network a unique number; an IPv6 address is written as groups of characters separated by colons, for example 2001:db8::1.

There is also a form field, django.forms.GenericIPAddressField. A form field is the part of a web form that accepts one particular kind of answer, such as an email address or a phone number. This one accepts an IP address typed in by a user. When the form is submitted, the field checks that what was typed is a real address.

A separate model field, django.db.models.GenericIPAddressField, does a different kind of validation, closer to the database layer. The advisory states it was not affected.

Validating an IPv6 address means checking that a string is a well-formed address: the right characters, the right number of groups, and correct use of the : separator and the :: shorthand that squeezes out runs of zeros. The vulnerable functions did this without any upper bound on the length of the string they were given. An upper bound is simply a maximum: a rule that says "nothing longer than this is allowed".

Setup

No accounts, roles, tools or versions are described in the report. The researcher worked against the Django codebase and reported the issue through the Internet Bug Bounty programme on HackerOne, a platform where security researchers report bugs to the organisations that run bug bounty programmes. The report does not describe a specific deployment, request or test harness. A test harness is a setup built specifically to run a piece of software under controlled conditions for testing.

Finding it

The researcher identified that the IPv6 validation routines did not enforce an upper bound on the length of the input string. When a large malformed string containing many repeated : characters, of the form abcd:abcd:abcd:....., is passed to the validation functions, the processing consumes a large amount of resources and becomes slow. That slowdown is what turns the missing length limit into a denial-of-service condition.

A useful comparison is a bouncer at a door who is told to check every single person's ID, no matter how long the queue is, instead of turning away anyone who arrives with an obviously fake document. If someone hands over a stack of papers a metre thick, the bouncer reads all of it before saying no. The work is wasted, and everyone behind waits.

The two affected functions named in the report are is_valid_ipv6_address and clean_ipv6_address. The report describes them as undocumented and private functions. Private here means they are internal helpers, not part of the public interface Django promises to keep stable, so most developers never call them directly. The same weakness reached ordinary users through django.forms.GenericIPAddressField, which calls into this validation path when a form is submitted.

Exploitation

Step 1: Supply an oversized malformed IPv6 string

The input pattern is a long string built from repeated groups separated by colons, for example:

Text
abcd:abcd:abcd:.....

Line by line, this is a single piece of text, not a program. abcd is just four characters used as a stand-in group, the same way a real IPv6 address has groups of characters. Each : is the colon separator that real IPv6 addresses use between groups. The ..... at the end stands for "and so on", meaning the pattern keeps repeating far beyond what is shown. The important properties are the length of the string and the repeated : separators. The string is malformed as an IPv6 address, but it is still handed to the validation code, which has no limit on how much input it will process.

Step 2: Trigger validation through the form field

Any path that passes attacker-controlled input to is_valid_ipv6_address, clean_ipv6_address or django.forms.GenericIPAddressField will exercise the vulnerable code. Attacker-controlled means the person sending the data decides what is in it, rather than the website. The report does not include a request, URL, parameter name or response for this step; it identifies the functions and the form field as the entry points. An entry point is any place where outside data gets into the program.

Step 3: Observe resource consumption

The result of the oversized input is heavy resource consumption and slower processing. Resources here means the server's processor time and memory, the same way a computer slows down when too many programs run at once. The oversized input causes heavy resource consumption and slower processing, the denial-of-service effect described in the report. A worker is one of the processes a web server uses to handle incoming requests; if it is stuck on one job, it cannot take the next.

Root cause

The validation routines did not enforce an upper bound on the length of the string they were asked to validate. A valid IPv6 address has a bounded textual length, so any input far beyond that bound can be rejected immediately. Without such a check, the code continues to process the whole malformed string, and the cost grows with the input the attacker supplies. The report attributes the issue to this lack of upper bound limit enforcement.

The weakness is classified as allocation of resources without limits or throttling. Allocation of resources means handing out processor time or memory to do work; throttling means slowing down or capping how much any one request may use. Without either, a single request can take as much as it likes.

Impact

An attacker who can get a large malformed string into IPv6 validation can cause a denial-of-service attack through resource consumption and slow processing. The affected surface is the private validation functions and the django.forms.GenericIPAddressField form field. The django.db.models.GenericIPAddressField model field was not affected, so the exposure depends on whether an application passes user input into the form field or the validation functions. The report does not quantify the size of string needed or the resulting slowdown.

Fix

The report links the Django security advisory for CVE-2024-56374, published with the security releases of 14 January 2025. django.forms.GenericIPAddressField was updated to define a max_length of 39 characters, which limits the length of input accepted by the form field.. max_length is a setting that says "reject anything longer than this". The advisory notes that the model field did not need changing.

Variants to test

  • Other validators that accept structured text with separators, such as MAC address, CIDR, hostname or URL parsers. A MAC address is a hardware identifier written with colons or hyphens; CIDR is a compact way of writing a range of IP addresses; a hostname is a computer's name on a network; a URL parser reads web addresses. A positive result is processing time that grows with input length well past any legitimate maximum.
  • Form fields that wrap such validators. A positive result is a submitted oversized value that reaches the parser instead of being rejected on length.
  • Private or undocumented helper functions called directly by application code. A positive result is a code path where user input reaches the helper without a length check upstream. Upstream means earlier in the flow, before the helper is reached.

Hunting notes

This kind of bug hides in validation and parsing helpers that assume input is already bounded, especially private functions that application code calls directly and form fields that wrap them. During recon, meaning the early stage of looking around a target to see what it exposes, look for endpoints that accept IP addresses, hostnames or other structured strings and pass them into framework validators. An endpoint is a specific address on a website that accepts requests. The report establishes impact by naming the exact functions and form field affected, describing the malformed input pattern, and linking the resulting CVE and Django security advisory; it does not include a measured timing or request log.

Glossary

  • CVE: a public catalogue number for a known security vulnerability, so people can look it up and track the fix.
  • Django: a free web framework written in Python, used to build websites.
  • Python: a popular programming language.
  • Web framework: a collection of ready-made building blocks developers use to build a website.
  • Repository: a project's folder of source code together with its history, often hosted on a site such as GitHub.
  • GitHub: a website where source code is stored and shared.
  • Asset: the piece of software or system a bug bounty programme agrees to accept reports about.
  • Function: a named block of code that does one job and can be called from elsewhere.
  • Validation: checking that something is correct or acceptable before the program relies on it.
  • IPv6: the newer version of the addressing system that gives every device on a network a unique number, written as groups separated by colons.
  • Form field: the part of a web form that accepts one particular kind of answer.
  • Model field: the part of a Django data model that describes and checks one stored value, closer to the database layer.
  • Upper bound: a maximum limit; a rule that nothing longer or larger is allowed.
  • Denial-of-service (DoS): an attack that makes a service unavailable to normal users, often by exhausting its resources.
  • Resource consumption: use of a server's processor time or memory to do work.
  • Worker: one of the processes a web server uses to handle incoming requests.
  • Private function: an internal helper not meant to be called directly by outside code.
  • Attacker-controlled: data whose contents are decided by the person sending it, not by the website.
  • Entry point: any place where outside data gets into the program.
  • Allocation of resources without limits or throttling: a weakness where a request can use as much processor time or memory as it likes, with no cap or slowdown.
  • Throttling: deliberately slowing down or capping how much any one request may use.
  • max_length: a setting that rejects input longer than a stated number of characters.
  • HackerOne: a platform where security researchers report bugs to organisations that run bug bounty programmes.
  • Internet Bug Bounty: the bug bounty programme through which this issue was reported.
  • Test harness: a setup built specifically to run software under controlled conditions for testing.
  • MAC address: a hardware identifier written with colons or hyphens.
  • CIDR: a compact way of writing a range of IP addresses.
  • Hostname: a computer's name on a network.
  • URL parser: code that reads and breaks down web addresses.
  • Endpoint: a specific address on a website that accepts requests.
  • Recon: the early stage of looking around a target to see what it exposes.
  • Upstream: earlier in the flow, before the point being discussed.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.