{"record":{"id":"21489399e9154f7d","repo":"tinyhumansai/openhuman","slug":"file-urls-are-not-allowed-in-browser-automation","errorCode":null,"errorMessage":"file:// URLs are not allowed in browser automation","messagePattern":"file:// URLs are not allowed in browser automation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/browser/browser.rs","lineNumber":293,"sourceCode":"                anyhow::bail!(\n                    \"browser.backend='auto' needs Playwright, agent-browser tool, browser-native, or computer-use sidecar\"\n                )\n            }\n        }\n    }\n\n    /// Validate URL against allowlist\n    fn validate_url(&self, url: &str) -> anyhow::Result<()> {\n        let url = url.trim();\n\n        if url.is_empty() {\n            anyhow::bail!(\"URL cannot be empty\");\n        }\n\n        // Block file:// URLs — browser file access bypasses all SSRF and\n        // domain-allowlist controls and can exfiltrate arbitrary local files.\n        if url.starts_with(\"file://\") {\n            anyhow::bail!(\"file:// URLs are not allowed in browser automation\");\n        }\n\n        if !url.starts_with(\"https://\") && !url.starts_with(\"http://\") {\n            anyhow::bail!(\"Only http:// and https:// URLs are allowed\");\n        }\n\n        if self.allowed_domains.is_empty() && !allow_all_browser_domains() {\n            anyhow::bail!(\n                \"Browser tool enabled but no allowed_domains configured. \\\n                Add [browser].allowed_domains in config.toml or set OPENHUMAN_BROWSER_ALLOW_ALL=1\"\n            );\n        }\n\n        let host = extract_host(url)?;\n\n        if is_private_host(&host) {\n            anyhow::bail!(\"Blocked local/private host: {host}\");\n        }","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/browser/browser.rs#L275-L311","documentation":"validate_url unconditionally blocks file:// URLs in browser automation. Local file access would bypass all SSRF and domain-allowlist controls and let page content exfiltrate arbitrary local files, so the scheme is refused regardless of config or allow-all settings.","triggerScenarios":"Thrown at src/openhuman/tools/impl/browser/browser.rs:293 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read local files with file tools instead of the browser.","Serve the content over a local http server and allowlist that host if browsing is required."],"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"}