From 264fffbc6c65364b9d0719b9114803215ac46c3b Mon Sep 17 00:00:00 2001 From: Jeremy Grossmann Date: Sat, 11 Apr 2026 17:34:53 +0800 Subject: [PATCH] Potential fix for pull request finding 'CodeQL / Information exposure through an exception' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- gns3server/controller/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index b686069b4..9d633f526 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -779,8 +779,9 @@ class Project: try: with open(self._snapshot_conf_path, encoding="utf-8") as f: self._snapshot_conf = json.load(f) - except (OSError, UnicodeDecodeError, ValueError) as e: - raise aiohttp.web.HTTPConflict(text="Could not read snapshot config {}: {}".format(self._snapshot_conf_path, str(e))) + except (OSError, UnicodeDecodeError, ValueError): + log.exception("Could not read snapshot config %s", self._snapshot_conf_path) + raise aiohttp.web.HTTPConflict(text="Could not read snapshot configuration file") # Load all legacy snapshots (.gns3project files) to create an initial snapshot config if it doesn't exist if os.path.exists(snapshot_dir) and not self._snapshot_conf: