pub struct SafeDnsResolver { /* private fields */ }Expand description
Custom DNS resolver that re-validates resolved IPs against the
IpPolicy at connect time.
SECURITY (F-NET-2): the parse-time IP blocklist on SafeUrl::parse
catches http://127.0.0.1 and http://169.254.169.254 literally, but
an attacker who controls evil.com with TTL=0 can return 8.8.8.8
(passes parse) and then 127.0.0.1 (used at TCP connect). This
resolver re-applies the blocklist to every resolved SocketAddr —
rebind attempts fail with a connect-time error before any byte
reaches the loopback / metadata service.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SafeDnsResolver
impl RefUnwindSafe for SafeDnsResolver
impl Send for SafeDnsResolver
impl Sync for SafeDnsResolver
impl Unpin for SafeDnsResolver
impl UnsafeUnpin for SafeDnsResolver
impl UnwindSafe for SafeDnsResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more