diff --git a/src/api/server_server.rs b/src/api/server_server.rs index 3ab5709c..58db059f 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -132,7 +132,9 @@ where )); } - if destination.is_ip_literal() { + // rust's built in parsing does not consider things like octal addresses valid + // so we should check both just to be safe. + if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) { info!( "Destination {} is an IP literal, checking against IP range denylist.", destination diff --git a/src/service/sending/mod.rs b/src/service/sending/mod.rs index b05bef2b..3bf18aac 100644 --- a/src/service/sending/mod.rs +++ b/src/service/sending/mod.rs @@ -717,7 +717,9 @@ impl Service { where T: Debug, { - if destination.is_ip_literal() { + // rust's built in parsing does not consider things like octal addresses valid + // so we should check both just to be safe. + if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) { info!( "Destination {} is an IP literal, checking against IP range denylist.", destination