tinyhumansai/openhuman · error

file:// URLs are not allowed in browser automation

Error message

file:// URLs are not allowed in browser automation

What it means

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.

Source

Thrown at src/openhuman/tools/impl/browser/browser.rs:293

                anyhow::bail!(
                    "browser.backend='auto' needs Playwright, agent-browser tool, browser-native, or computer-use sidecar"
                )
            }
        }
    }

    /// Validate URL against allowlist
    fn validate_url(&self, url: &str) -> anyhow::Result<()> {
        let url = url.trim();

        if url.is_empty() {
            anyhow::bail!("URL cannot be empty");
        }

        // Block file:// URLs — browser file access bypasses all SSRF and
        // domain-allowlist controls and can exfiltrate arbitrary local files.
        if url.starts_with("file://") {
            anyhow::bail!("file:// URLs are not allowed in browser automation");
        }

        if !url.starts_with("https://") && !url.starts_with("http://") {
            anyhow::bail!("Only http:// and https:// URLs are allowed");
        }

        if self.allowed_domains.is_empty() && !allow_all_browser_domains() {
            anyhow::bail!(
                "Browser tool enabled but no allowed_domains configured. \
                Add [browser].allowed_domains in config.toml or set OPENHUMAN_BROWSER_ALLOW_ALL=1"
            );
        }

        let host = extract_host(url)?;

        if is_private_host(&host) {
            anyhow::bail!("Blocked local/private host: {host}");
        }

View on GitHub (pinned to 7491200858)

Solutions

  1. Read local files with file tools instead of the browser.
  2. Serve the content over a local http server and allowlist that host if browsing is required.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/tools/impl/browser/browser.rs:293 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/21489399e9154f7d. Report an issue: GitHub.