{"record":{"id":"4d62ceef4f4e1abb","repo":"Hmbown/CodeWhale","slug":"managed-directory-path-cannot-contain-traversal-co","errorCode":null,"errorMessage":"managed directory path cannot contain traversal components","messagePattern":"managed directory path cannot contain traversal components","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/session_manager.rs","lineNumber":65,"sourceCode":"const fn default_queue_schema_version() -> u32 {\n    CURRENT_QUEUE_SCHEMA_VERSION\n}\n\nfn normalize_managed_dir(path: PathBuf) -> std::io::Result<PathBuf> {\n    if path.as_os_str().is_empty() {\n        return Err(std::io::Error::new(\n            std::io::ErrorKind::InvalidInput,\n            \"managed directory path cannot be empty\",\n        ));\n    }\n    if path.components().any(|component| {\n        matches!(\n            component,\n            Component::ParentDir | Component::Prefix(_) | Component::RootDir\n        )\n    }) && path.is_relative()\n    {\n        return Err(std::io::Error::new(\n            std::io::ErrorKind::InvalidInput,\n            \"managed directory path cannot contain traversal components\",\n        ));\n    }\n    if path.is_absolute() {\n        return Ok(path);\n    }\n    std::env::current_dir().map(|cwd| cwd.join(path))\n}\n\n/// Persisted queued message for offline/degraded mode.\n#[derive(Debug, Clone, Serialize, Deserialize)]\npub struct QueuedSessionMessage {\n    pub display: String,\n    #[serde(default)]\n    pub skill_instruction: Option<String>,\n    #[serde(default)]\n    pub skill_provenance: Option<crate::plugins::types::PluginAuthority>,","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/session_manager.rs#L47-L83","documentation":"Traversal guard in normalize_managed_dir: a relative managed-directory path contains ParentDir, Prefix, or RootDir components, which could escape the intended base directory. Such paths are rejected so managed session storage cannot be redirected outside its root.","triggerScenarios":"Thrown at crates/tui/src/session_manager.rs:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure a plain relative path (no `..`, no drive/root prefix) for the managed directory.","Resolve any absolute or parent-relative path to the intended base directory before passing it in."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}