{"record":{"id":"72a449f292dcfca2","repo":"tinyhumansai/openhuman","slug":"dest-path-may-not-contain","errorCode":null,"errorMessage":"dest_path may not contain '..'","messagePattern":"dest_path may not contain '\\.\\.'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/network/curl.rs","lineNumber":68,"sourceCode":"    /// `<workspace>/<dest_subdir>`. Rejects absolute paths, `..`\n    /// segments, and any other escape attempts.\n    fn resolve_dest(&self, dest: &str) -> anyhow::Result<PathBuf> {\n        let trimmed = dest.trim();\n        if trimmed.is_empty() {\n            anyhow::bail!(\"dest_path cannot be empty\");\n        }\n\n        let p = Path::new(trimmed);\n        if p.is_absolute() {\n            anyhow::bail!(\"dest_path must be relative — got absolute path\");\n        }\n\n        for component in p.components() {\n            match component {\n                Component::Normal(_) => {}\n                Component::CurDir => {}\n                Component::ParentDir => {\n                    anyhow::bail!(\"dest_path may not contain '..'\");\n                }\n                Component::Prefix(_) | Component::RootDir => {\n                    anyhow::bail!(\"dest_path must be relative\");\n                }\n            }\n        }\n\n        let root = self.workspace_dir.join(&self.dest_subdir);\n        let resolved = root.join(p);\n\n        // Belt-and-braces: ensure the resolved path still lives under root.\n        // Lexical check is sufficient because we already rejected `..`.\n        if !resolved.starts_with(&root) {\n            anyhow::bail!(\"dest_path resolves outside the downloads root\");\n        }\n\n        Ok(resolved)\n    }","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/network/curl.rs#L50-L86","documentation":"A component of dest_path is ParentDir ('..'), which would climb out of the downloads directory; the jail rejects it during component-by-component validation.","triggerScenarios":"Thrown at src/openhuman/tools/impl/network/curl.rs:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove '..' segments from dest_path","Reference the desired location directly under the downloads root"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}