-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix(ext/node): better dns.lookup compatibility #27936
base: main
Are you sure you want to change the base?
Conversation
c52102f
to
99e4206
Compare
99e4206
to
1d63322
Compare
9b61e7d
to
933b5a4
Compare
I'll also try to implement net permission checks for dns.lookup (op_getaddrinfo) (which checks the net permission with hostnames, not name servers or config files). |
da43e90
to
6480e07
Compare
6480e07
to
d0a4740
Compare
bc43984
to
9cde2d9
Compare
12435f9
to
9eb2828
Compare
This reverts commit 9cde2d9.
@bartlomieju @lucacasonato Now I think this is ready for review. PTAL. This now implements the token idea, which is created from |
This PR improves the dns.lookup compatibility to Node.js.
Currently we use hickory-dns for looking up ipv4 and ipv6 addresses, but this seems causing lot of edge case issues about dns resolution (#27670, #27642, #27384, #27803). This PR changes it to use
getaddrinfo
to align it better to Node.js.This fixes #27670
This could possibly have effect to #27642, #27384, and #27803
This PR also fixes the permission requirement for
net.connect(hostname)
. Currently we require net permission of addresses of name servers and resolved ips. This PR change it to require only requested domain (nowhttp.request(url)
prompts the same permission asfetch(url)
To achieve that,
op_node_getaddrinfo
returnsNetPermToken
object. The token is passed toop_net_connect_tcp
, and validates the ips in it. If token has a valid ip, then the permission is checked against domain name in the token, instead of the given ip address.This fixes #27634
Remaining:
op_getaddrinfo
happens in unit_node/http_test in a flaky wayport large dns response test from fix(ext/net): enable EDNS0 for Deno.resolveDns #27735http(s).request