Skip to content

馃敀 fix: prevent IndexError DoS in get_datanodes_link - #3

Open
Saimonokuma wants to merge 1 commit into
suff3r1ng:mainfrom
Saimonokuma:fix-datanodes-index-error-dos-461673249490306263
Open

馃敀 fix: prevent IndexError DoS in get_datanodes_link#3
Saimonokuma wants to merge 1 commit into
suff3r1ng:mainfrom
Saimonokuma:fix-datanodes-index-error-dos-461673249490306263

Conversation

@Saimonokuma

Copy link
Copy Markdown

This commit adds a safety check to ensure that the URL path contains the expected number of segments before attempting to access them. Previously, a malformed URL or a root URL (e.g., https://datanodes.to) would cause an unhandled IndexError, leading to a Denial of Service for the script.

The function now returns None if the path is invalid, which is correctly handled by the calling function.

This commit adds a safety check to ensure that the URL path contains the expected
number of segments before attempting to access them. Previously, a malformed URL
or a root URL (e.g., https://datanodes.to) would cause an unhandled IndexError,
leading to a Denial of Service for the script.

The function now returns None if the path is invalid, which is correctly handled
by the calling function.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
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.

1 participant