From 93642cd5d712316bc8cfc54af54222c522a5593c Mon Sep 17 00:00:00 2001 From: me Date: Sun, 13 Jul 2025 15:58:03 -0700 Subject: [PATCH] Fix IPv6 addresses with IPv4 trusted proxies When an IPv6 address that doesn't map to an IPv4 address was checked against an IPv4 trusted proxy, we'd hit an exception because ip.ipv4_mapped was None. Fix this by verifying ipv4_mapped is not None --- frigate/api/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/api/auth.py b/frigate/api/auth.py index 6577f9c23..9459c4ac8 100644 --- a/frigate/api/auth.py +++ b/frigate/api/auth.py @@ -71,7 +71,7 @@ def get_remote_addr(request: Request): ) if trusted_proxy.version == 4: ipv4 = ip.ipv4_mapped if ip.version == 6 else ip - if ipv4 in trusted_proxy: + if ipv4 is not None and ipv4 in trusted_proxy: trusted = True logger.debug(f"Trusted: {str(ip)} by {str(trusted_proxy)}") break