From 6b8039452bf36a280c30abfad86fe9dc0e41c46f Mon Sep 17 00:00:00 2001 From: gamesiati <37198413+Gamesiati@users.noreply.github.com> Date: Wed, 26 Mar 2025 02:36:58 -0500 Subject: [PATCH 1/2] fix: fix IP validation for allowing only IPv4 Addresses --- backend/OBSController.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/OBSController.py b/backend/OBSController.py index 73b5d18..24b17d1 100644 --- a/backend/OBSController.py +++ b/backend/OBSController.py @@ -26,7 +26,7 @@ def validate_ip(self, host: str): # previous implementations. Again, probably the wrong thing # long-term, but implementing this way to mitigate risk while we're # in a bad-push state. - if not addr.version == ipaddress.IPv4Address.version: + if addr.version == 6: raise ValueError() return True except ValueError: From 9e3faf143e0ae21983fdda36df5a8ad634215b12 Mon Sep 17 00:00:00 2001 From: gamesiati <37198413+Gamesiati@users.noreply.github.com> Date: Thu, 27 Mar 2025 05:52:46 -0500 Subject: [PATCH 2/2] fix: fix IPv4 addresses always returning true Only localhost or 127.0.0.1 now work --- backend/OBSController.py | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/OBSController.py b/backend/OBSController.py index 24b17d1..44d605c 100644 --- a/backend/OBSController.py +++ b/backend/OBSController.py @@ -28,7 +28,6 @@ def validate_ip(self, host: str): # in a bad-push state. if addr.version == 6: raise ValueError() - return True except ValueError: return False