java-debug plugin download not validated — truncated jar silently disables debugging

Open
#324 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java, rust
Domain
devtools

Research direction

The download and install logic for the java-debug plugin jar lives in the Rust extension code of this repository, so start by locating where the debugger jar is fetched and where its presence is checked. Add a size or checksum comparison against the release asset and re-download on mismatch, and confirm the error path surfaces a bundle-load failure. Done means a truncated jar is detected and replaced on the next start, which can be checked by truncating the file manually and restarting.

Written by the indexing model from the issue text.

Description

Summary

The com.microsoft.java.debug.plugin jar is downloaded without any integrity check. A truncated file is accepted as a valid install and silently breaks all debugging.

What happened

  • Extension version: 6.8.30 (WSL remote, Zed 1.26.2)
  • The downloaded debugger/com.microsoft.java.debug.plugin-0.53.2.jar was 668,580 bytes instead of the real 3,107,682 bytes (download interrupted back in April; no validation, so the fragment was kept)
  • On every jdtls start, bundle loading fails (visible in jdtls ~/.cache/jdtls-*/.metadata/.log):
    Cannot extract bundle symbolicName or version .../com.microsoft.java.debug.plugin-0.53.2.jar
    
  • Consequently all debug delegate commands are unregistered: any debug session reports
    No delegateCommandHandler for vscode.java.resolveMainClass
  • This state persisted for months because nothing surfaces the load failure

Fix suggestion: validate the download (size against the release / checksum) and re-download on mismatch, or at least surface bundle-load failures to the user.

Workaround that fixed it locally: re-download the jar from https://github.com/zed-industries/java-debug/releases/download/0.53.2/com.microsoft.java.debug.plugin-0.53.2.jar and fully restart Zed.

Dominant language
Rust
Stars
225
Forks
47
Avg merge
3h 51m
Merged PRs (30d)
7

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zed-extensions/java

All issues in zed-extensions/java

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.