zed-industries/zed · error

invalid binary file name: {file_name}

Error message

invalid binary file name: {file_name}

What it means

After percent-decoding the last URL segment intended as the raw binary file name, the result failed validation (empty or containing path separators), so it cannot be used as a safe file name during download and extraction of a raw-binary registry artifact.

Source

Thrown at crates/project/src/agent_server_store.rs:961

        bail!("unsupported archive type {suffix} in URL: {archive_url}");
    } else {
        let file_name = raw_binary_file_name(&archive_path)
            .with_context(|| format!("determining binary file name from URL: {archive_url}"))?;
        Ok(RegistryArchiveKind::RawBinary { file_name })
    }
}

fn raw_binary_file_name(archive_path: &str) -> Result<String> {
    let last_segment = archive_path
        .rsplit('/')
        .next()
        .filter(|segment| !segment.is_empty())
        .context("URL has no file name")?;
    let file_name = percent_decode_str(last_segment)
        .decode_utf8()
        .context("file name is not valid UTF-8")?
        .into_owned();
    anyhow::ensure!(
        !file_name.is_empty()
            && file_name != "."
            && file_name != ".."
            && !file_name.contains(['/', '\\'])
            && !file_name.contains('\0'),
        "invalid binary file name: {file_name}"
    );
    Ok(file_name)
}

struct GithubReleaseArchive {
    repo_name_with_owner: String,
    tag: String,
    asset_name: String,
}

fn github_release_archive_from_url(archive_url: &str) -> Option<GithubReleaseArchive> {
    fn decode_path_segment(segment: &str) -> Option<String> {

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Fix the registry entry's download URL so its final segment is a plain file name
  2. Sanitize or reject the decoded name before it reaches this validation if URLs can be user-supplied
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/project/src/agent_server_store.rs:961 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/5dd8b17cce06fdd0. Report an issue: GitHub.