From a201e9886ef40091773dc591b9ff490109aa610b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 25 Jun 2026 09:48:11 -0400 Subject: [PATCH] Have messages force normalizing the incoming filenames This avoids downstream code that may expect specific locations from being confused. --- confluent_server/confluent/messages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 4dfbabf5..4f2aabc1 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -19,6 +19,7 @@ # Things are defined here to 'encourage' developers to coordinate information # format. This is also how different data formats are supported import base64 +import os import confluent.exceptions as exc import confluent.config.configmanager as cfm import confluent.config.conf as cfgfile @@ -604,6 +605,9 @@ class InputFirmwareUpdate(ConfluentMessage): node, value = expanded if value != self._filename: self._complexname = True + value = os.path.normpath(value) + if value.startswith('../'): + raise Exception('File transfer with ../ is not supported') self.filebynode[node] = value @property