From ee091a26c7a253f85551215286fe336058323554 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Fri, 23 Oct 2026 12:44:25 -0700 Subject: [PATCH] fix(security): guard the Windows form probes on a token of their own The no-filesystem guard matched "C:", which on a Windows runner is also the temporary ComfyUI tree the save may resolve for its trusted first entry. The probe paths now carry a token no trusted directory holds. --- tests/test_settings_sources.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_settings_sources.py b/tests/test_settings_sources.py index 6998c82b..e4958bd8 100644 --- a/tests/test_settings_sources.py +++ b/tests/test_settings_sources.py @@ -604,14 +604,16 @@ class TestValidateSource(SourcesTestCase): windows = functools.partial(sources.source_form_error, windows=True) with ( patch.object(sources, "source_form_error", windows), - no_filesystem_access_for("C:", self), + # The probes hold a token no trusted directory does (on Windows the + # temporary ComfyUI tree itself sits on C:). + no_filesystem_access_for("PMProbe", self), ): for path in ( - "\\\\?\\C:\\ComfyUI\\output", - "\\\\.\\pipe\\x", - "C:\\ComfyUI\\output\\CON", - "C:\\ComfyUI\\output\\a:stream", - "C:ComfyUI", + "\\\\?\\C:\\PMProbe\\output", + "\\\\.\\pipe\\PMProbe", + "C:\\PMProbe\\output\\CON", + "C:\\PMProbe\\output\\a:stream", + "C:PMProbe", ): with self.subTest(path=path): _roots, error = self.api._parse_gallery_roots(