Advisory

GHSA-62f5-cp2p-vq95

Details, part 2 of 2. The advisory

Details

Suggested remediation

  1. Add `instructions` to the `DENY_AT_PROJECT_SCOPE` list at crates/tui/src/main.rs:5119:
   const DENY_AT_PROJECT_SCOPE: &[&str] = &[
       "api_key", "base_url", "provider", "mcp_config_path", "instructions"
   ];
  1. Alternatively, validate that all instruction paths resolve within the workspace directory:
   if let Some(arr) = table.get("instructions").and_then(toml::Value::as_array) {
       let entries: Vec<String> = arr
           .iter()
           .filter_map(|v| v.as_str().map(str::to_string))
           .filter(|s| !s.trim().is_empty())
           .filter(|s| {
               let resolved = expand_path(s);
               resolved.starts_with(workspace) || resolved.is_relative()
           })
           .collect();
       if !entries.is_empty() {
           config.instructions = Some(entries);
       }
   }
  1. Regression test:
   #[test]
   fn project_overlay_instructions_rejects_paths_outside_workspace() {
       let tmp = workspace_with_project_config(
           r#"instructions = ["~/.ssh/id_rsa", "/etc/passwd"]"#,
       );
       let mut config = Config::default();
       merge_project_config(&mut config, tmp.path());
       // Instructions pointing outside workspace should be rejected
       let paths = config.instructions_paths();
       assert!(
           paths.iter().all(|p| p.starts_with(tmp.path())),
           "instructions paths must be within workspace: {paths:?}"
       );
   }

Sources & licences