Skip to content

Idna resource reduction using a length check#247

Merged
saghul merged 6 commits intosaghul:masterfrom
Vizonex:idna-resource-reduction
Jul 19, 2025
Merged

Idna resource reduction using a length check#247
saghul merged 6 commits intosaghul:masterfrom
Vizonex:idna-resource-reduction

Conversation

@Vizonex
Copy link
Contributor

@Vizonex Vizonex commented Jul 18, 2025

There's a small possibility that this library is vulnerable to CVE-2024-3651 since pycares allows versions of idna that are lower than 3.7 to be used. I have added in a special check to ensure that this resource attack will never happen since specially crafted inputs by an attacker can be a future problem to someone who may for example write a DNS website with python only to later have an attacker launch a very sophisticated payload. Domains can only be a size of 253 characters which is the maximum so knowing that I added in a security check to say that if any part is greater than 253 raise a RuntimeError. If you think I should put this check somewhere else in the function please let me know.

@Vizonex Vizonex changed the title Idna resource reduction security check Idna resource reduction using a length check Jul 18, 2025
Copy link
Owner

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you please add a test perhaps?

@Vizonex
Copy link
Contributor Author

Vizonex commented Jul 18, 2025

Thanks! Could you please add a test perhaps?

Sure I would love to ^^

@Vizonex
Copy link
Contributor Author

Vizonex commented Jul 18, 2025

I reformatted and sorted test files with isort & ruff hope you don't mind.

@saghul saghul merged commit 1787759 into saghul:master Jul 19, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants