I would like a comprehensive explanation of the security and privacy risks that come with DNS prefetching. There are already other posts about this topic, but I want current information and feedback on my concerns. Thanks in advance.
The Helmet.js documentation says X-DNS-Prefetch-Control
is turned off to improve user privacy, but doesn't explain why DNS prefetching is a privacy concern. Is turning DNS prefetching off generally a good default?
helmet.dnsPrefetchControl
sets theX-DNS-Prefetch-Control
header to help control DNS prefetching, which can improve user privacy at the expense of performance. See documentation on MDN for more.
I've read that DNS prefetching is done in plaintext, which can reveal information if there's a MITM attack, but is that information current? If so, why are the requests plaintext?
This article shows how you can bypass the CSP with DNS prefetching. Have things changed since the article was written in 2016?
I feel that this OWASP Cheatsheet excerpt should be included so you know what I know.
The default behavior of browsers is to perform DNS caching which is good for most websites. If you do not control links on your website, you might want to set off as a value to disable DNS prefetch to avoid leaking information to those domains.