From 15ba3dc5ccc2fb03796c5e477d09eb4717d13d3f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 22 Oct 2026 18:19:13 -0400 Subject: [PATCH] security: submit XATTACH picked path as literal text, not a command line (CWE-74) (#1843) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The External References palette's XATTACH handler passed the file picker's result to `app.cmdline(&path)`. `cmdline` interprets command-line syntax, so a selected filename beginning with an apostrophe (for example `'closeall`) was run as an engine command rather than naming the file — closing every drawing without the UI's unsaved-change confirmation. The picked path is attacker-controlled (the picker returns whatever the user selected, and `relative_to_host` can reduce it to a bare basename). After starting XATTACH, submit it through `Session::input(Input::Text(path))` so it is delivered to the command's prompt as literal text and never interpreted as a command, matching how other picker/dialog bridges already behave. Addresses finding row 26. --- crates/ui-egui/src/xrefs.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/xrefs.rs b/crates/ui-egui/src/xrefs.rs index 5828169d..fb9cb9ef 100644 --- a/crates/ui-egui/src/xrefs.rs +++ b/crates/ui-egui/src/xrefs.rs @@ -24,7 +24,13 @@ pub fn route(app: &mut CadApp, id: &str, params: &Value) -> Option None,