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

Enable IPv6 Support #1

Open
wkcaj opened this issue May 19, 2014 · 6 comments
Open

Enable IPv6 Support #1

wkcaj opened this issue May 19, 2014 · 6 comments

Comments

@wkcaj
Copy link
Owner

wkcaj commented May 19, 2014

Currently SafeCurl only supports IPv4.

This is due to the gethostbynamel function in PHP only supporting v4 addresses.

IPv6 support could be done via calls to dig, however, this could be dangerous. Investigation needed.

@ValdikSS
Copy link

If there was IPv6 support in safecurl, it would be possible to get btc.txt with the current blacklists with http://[::1]/btc.txt. But since the code tries to resolve [::1] with gethostbynamel() and fails, it doesn't work.

@ValdikSS
Copy link

And don't forget about IPv4-IPv6 mapping via ::ffff:aaaa:bbbb

@ValdikSS
Copy link

Anyway, you should use dns_get_record() and resolve both A and AAAA records.

@wkcaj
Copy link
Owner Author

wkcaj commented May 20, 2014

Great idea. This is something I'll work on tonight and hopefully get merged in.

@wkcaj wkcaj self-assigned this May 21, 2014
@mozfreddyb
Copy link

For completeness' sake I'd like to mention the ip6-localnet, ip6-localhost ip6-loopback host names defined in /etc/hosts. But the current setup that checks the numerical IP shouldn't make it a bypass.

If you support IPv6 you'll have to block a lot of subnets and I'm not sure I remember all of them.

  • fe80::/10
  • ff00::/8 (multicast)
  • ::/16
  • ...

Maybe even those in 6to4 that imply private IP6 (e.g., 2002:quad1:quad2:quad3:quad4::) even though that highly depends on 6to4 routing and setup.

I found these docs useful resources once: https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xml and http://computernetworkingnotes.com/ipv6-features-concepts-and-configurations/special-ipv6-to-devices.html

@mogul
Copy link

mogul commented Jun 16, 2020

Have you considered using PHP's filter_var() with appropriate flags?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants