From d81374ebc7292bbdea28826408c657f1f64fef2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20I=C3=B1iguez=20Goia?= Date: Fri, 21 Feb 2025 00:28:22 +0100 Subject: [PATCH] ui,popups: fixed dest host regexp We were not matching the end of the domain, which could lead to allow more domains than expected. kudos to @FWDekker for reporting this issue. Closes: #1264 --- ui/opensnitch/dialogs/prompt/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/opensnitch/dialogs/prompt/_utils.py b/ui/opensnitch/dialogs/prompt/_utils.py index b216f3a9..b6470d0d 100644 --- a/ui/opensnitch/dialogs/prompt/_utils.py +++ b/ui/opensnitch/dialogs/prompt/_utils.py @@ -193,7 +193,7 @@ def get_combo_operator(data, comboText, con): text = parts[len(parts)-1] # ^(|.*\.)yahoo\.com dsthost = r'\.'.join(text.split('.')).replace("*", "") - dsthost = r'^(|.*\.)%s' % dsthost[2:] + dsthost = r'^(|.*\.)%s$' % dsthost[2:] return Config.RULE_TYPE_REGEXP, Config.OPERAND_DEST_HOST, dsthost elif data == _constants.FIELD_REGEX_IP: