Skip to content

testgen-hs executable probe accepts any runnable binary #538

Description

@ginnun

In crates/node/src/cbor/fallback_decoder.rs (and after #537 merges, in crates/testgen/src/testgen.rs), the helper that looks up testgen-hs on disk validates candidates like this:

fn is_our_executable(path: &Path) -> bool {
    Command::new(path).arg("--version").output().is_ok()
}

.is_ok() only means the child could be spawned and its output captured, a non-zero exit code or unrelated --version text is still accepted. An unrelated binary named testgen-hs on PATH, or a broken build, can pass this check.

The same pattern exists in crates/common/src/find_libexec.rs:77 (already carrying a TODO comment there).

Flagged by Copilot

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions