pub struct SsrfSafeResolver { /* private fields */ }Expand description
A ureq::unversioned::resolver::Resolver that pins DNS resolution to the
exact lookup used for the SSRF check.
SafeUrl::ensure_resolves_safely and ureq’s own resolver each perform an
independent DNS lookup, which opens a rebinding window: a hostile resolver
with a short TTL can answer the first (validation) query with a public
address and the second (connect) query with a blocked one (e.g. the cloud
metadata IP or loopback). Passing this resolver to the ureq::Agent makes
resolution and validation the same lookup, so there is no second query left
to rebind.
Trait Implementations§
Source§impl Debug for SsrfSafeResolver
impl Debug for SsrfSafeResolver
Source§impl Default for SsrfSafeResolver
impl Default for SsrfSafeResolver
Source§fn default() -> SsrfSafeResolver
fn default() -> SsrfSafeResolver
Returns the “default value” for a type. Read more
Source§impl Resolver for SsrfSafeResolver
impl Resolver for SsrfSafeResolver
Source§fn resolve(
&self,
uri: &Uri,
config: &Config,
timeout: NextTimeout,
) -> Result<ResolvedSocketAddrs, Error>
fn resolve( &self, uri: &Uri, config: &Config, timeout: NextTimeout, ) -> Result<ResolvedSocketAddrs, Error>
Resolve the URI to a socket address. Read more
Source§fn empty(
&self,
) -> ArrayVec<SocketAddr, ureq::::unversioned::resolver::ResolvedSocketAddrs::{constant#0}>
fn empty( &self, ) -> ArrayVec<SocketAddr, ureq::::unversioned::resolver::ResolvedSocketAddrs::{constant#0}>
Produce an empty array of addresses.
Auto Trait Implementations§
impl Freeze for SsrfSafeResolver
impl RefUnwindSafe for SsrfSafeResolver
impl Send for SsrfSafeResolver
impl Sync for SsrfSafeResolver
impl Unpin for SsrfSafeResolver
impl UnsafeUnpin for SsrfSafeResolver
impl UnwindSafe for SsrfSafeResolver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more