Internationalized Domain Names in Applications (IDNA) vulnerable to denial of service from specially crafted inputs to idna.encode
The idna.encode() function could consume significant resources when given a specially crafted argument, leading to a denial-of-service. An attacker could exploit this by passing arbitrarily large inputs to the library if the application does not enforce a length limit.
kjd/idna
Originally disclosed on huntr
Impact
A specially crafted argument to the idna.encode() function could consume significant resources. This may lead to a denial-of-service.
Patches
The function has been refined to reject such strings without the associated resource consumption in version 3.7.
Workarounds
Domain names cannot exceed 253 characters in length, if this length limit is enforced prior to passing the domain to the idna.encode() function it should no longer consume significant resources. This is triggered by arbitrarily large inputs that would not occur in normal usage, but may be passed to the library assuming there is no preliminary input validation by the higher-level application.
References
From the GitHub Advisory Database (GHSA-jjg7-2v4v-x38h, CC BY 4.0).
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 idna.encode() function did not properly limit or validate input length, allowing resource exhaustion with large inputs.
What the attacker needed
Application uses idna.encode() without length limit
The fix
The function was refined in version 3.7 to reject such strings without the associated resource consumption.
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.
The idna library helps convert domain names into a standard format. A bug meant that very long or specially crafted domain names could make the function use a lot of computer power, potentially slowing down or crashing the application. This is called a denial-of-service because it stops the service from working properly.
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.