Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Remove duplicate prefixes from sanitizer #1195

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

daenney
Copy link
Member

@daenney daenney commented Dec 1, 2022

In the previous changes that expanded the IPv4 and IPv6 deny lists based on the IANA registries we inadvertently added a number of duplicates. This is unnecessary as they're already caught by larger prefixes and means there's less entries to scan.

This change removes all prefixes that are subnets of other prefixes.

I solemnly swear this is the last of it.

In the previous changes that expanded the IPv4 and IPv6 deny lists based
on the IANA registries we inadvertently added a number of duplicates.
This is unnecessary as they're already caught by larger prefixes and
means there's less entries to scan.

This change removes all prefixes that are subnets of other prefixes.
netip.MustParsePrefix("2001:3::/32"), // AMT, RFC 7450
netip.MustParsePrefix("2001:4:112::/48"), // AS112-v6, RFC 7535
netip.MustParsePrefix("2001:10::/28"), // ORCHID, deprecated
netip.MustParsePrefix("2001:20::/28"), // ORCHIDv2
Copy link
Member Author

Choose a reason for hiding this comment

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

All the above 2001:.../xx prefixes are subnets of 2001::/23.

@@ -60,7 +52,6 @@ var (
netip.MustParsePrefix("169.254.0.0/16"), // Link-local
netip.MustParsePrefix("172.16.0.0/12"), // Private
netip.MustParsePrefix("192.0.0.0/24"), // RFC6890
netip.MustParsePrefix("192.0.0.0/29"), // IPv4 Service Continuity Prefix, RFC 7335
Copy link
Member Author

Choose a reason for hiding this comment

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

This one is caught by 192.0.0.0/24

@tsmethurst tsmethurst merged commit 558b448 into superseriousbusiness:main Dec 1, 2022
@daenney daenney deleted the ssrf-dupes branch December 1, 2022 19:37
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