From bcff95b109c5e6625d46708204d65a928a8a24c7 Mon Sep 17 00:00:00 2001 From: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com> Date: Thu, 6 Aug 2026 08:08:07 +0000 Subject: [PATCH] fix(node): reject rustc response files --- nodejs/build_support/x86_64_v2.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nodejs/build_support/x86_64_v2.rs b/nodejs/build_support/x86_64_v2.rs index a0ef3eb52..8161b5820 100644 --- a/nodejs/build_support/x86_64_v2.rs +++ b/nodejs/build_support/x86_64_v2.rs @@ -103,6 +103,10 @@ pub(crate) fn validate_encoded_rustflags(encoded: &str) -> Result<(), String> { fn codegen_options(encoded: &str) -> Result, String> { let arguments = encoded.split('\u{1f}').collect::>(); + if arguments.iter().any(|argument| argument.starts_with('@')) { + return Err("rustc response-file arguments cannot be validated".to_owned()); + } + let mut options = Vec::new(); let mut index = 0; @@ -262,4 +266,14 @@ mod tests { Err("LLVM arguments can override the CPU baseline".to_owned()) ); } + + #[test] + fn rejects_response_file_arguments() { + let flags = encoded(&["-Ctarget-cpu=x86-64-v2", "@flags.rsp"]); + + assert_eq!( + validate_encoded_rustflags(&flags), + Err("rustc response-file arguments cannot be validated".to_owned()) + ); + } }