From 779fce06aa616e4dd67a15d06e9f4b39258283f5 Mon Sep 17 00:00:00 2001 From: Bryan <74067792+Bryan-Roe@users.noreply.github.com> Date: Tue, 7 Jul 2026 04:20:54 -0700 Subject: [PATCH] Potential fix for code scanning alert no. 2333: Uncontrolled data used in path expression Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- scripts/gradio_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gradio_demo.py b/scripts/gradio_demo.py index 79a8f967a..9deaa2ddc 100644 --- a/scripts/gradio_demo.py +++ b/scripts/gradio_demo.py @@ -652,7 +652,7 @@ def save_conversation_markdown(hist_state: list[dict], session_name: str = "sess filename = os.path.realpath(os.path.join(conv_root, f"{safe_name}_{ts}.md")) if os.path.commonpath([conv_root, filename]) != conv_root: raise ValueError("Invalid session name") - temp_filename = os.path.realpath(os.path.join(conv_root, f"{safe_name}_{ts}.md.tmp")) + temp_filename = os.path.realpath(os.path.join(conv_root, f".tmp_{uuid.uuid4().hex}.md")) if os.path.commonpath([conv_root, temp_filename]) != conv_root: raise ValueError("Invalid session name") try: