zed-industries/zed · error

credential for {url} is {} bytes, which exceeds the Windows

Error message

credential for {url} is {} bytes, which exceeds the Windows Credential Manager limit of {CRED_MAX_CREDENTIAL_BLOB_SIZE} bytes

What it means

Pre-flight validation in `write_credentials`: the password blob exceeds CRED_MAX_CREDENTIAL_BLOB_SIZE (512 bytes), which CredWriteW would reject with the opaque RPC error 0x800706F7 'The stub received bad data'. The explicit check fails early with a clear message naming the URL and both sizes.

Source

Thrown at crates/gpui_windows/src/platform.rs:902

                break;
            }
        }
    }

    fn is_cursor_visible(&self) -> bool {
        self.inner.state.cursor_visible.load(Ordering::Relaxed)
    }

    fn should_auto_hide_scrollbars(&self) -> bool {
        should_auto_hide_scrollbars().log_err().unwrap_or(false)
    }

    fn write_to_clipboard(&self, item: ClipboardItem) {
        write_to_clipboard(item);
    }

    fn read_from_clipboard(&self) -> Option<ClipboardItem> {
        read_from_clipboard()
    }

    fn write_credentials(&self, url: &str, username: &str, password: &[u8]) -> Task<Result<()>> {
        // CredWriteW rejects larger blobs with the opaque RPC error
        // 0x800706F7 "The stub received bad data", so fail with a clear
        // message instead.
        if password.len() > CRED_MAX_CREDENTIAL_BLOB_SIZE as usize {
            return Task::ready(Err(anyhow!(
                "credential for {url} is {} bytes, which exceeds the Windows Credential Manager limit of {CRED_MAX_CREDENTIAL_BLOB_SIZE} bytes",
                password.len()
            )));
        }
        let password = password.to_vec();
        let mut username = username.encode_utf16().chain(Some(0)).collect_vec();
        let mut target_name = windows_credentials_target_name(url)
            .encode_utf16()
            .chain(Some(0))
            .collect_vec();

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Reject or truncate oversized credentials at a higher layer before calling write_credentials.
  2. Store large secrets outside Credential Manager (e.g. encrypted file with DPAPI) and keep a pointer in the credential.
  3. Document the 512-byte blob limit for Windows credential users.
  4. Return a typed error so callers can distinguish size failure from CredWriteW failure.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/gpui_windows/src/platform.rs:837 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/adbd7ce96f448990. Report an issue: GitHub.