Skip to content

[Bug bounty] unusable Windows bash stub suppresses Antigravity ensure hook #258

Description

@aikinley

Current release update (Aug. 6): Reproduced unchanged on the current v0.1.54 public artifact 2a4f9cf. PR #263 carries the minimal fix and an isolated regression covering both unusable and usable Bash commands.

Stage

connect

Coding agent

OpenAI Codex

Coding agent version

Codex desktop; Monk plugin v0.1.54 (2a4f9cf)

Repro steps

The native Windows Antigravity ensure-monk-agent.ps1 hook silently delegates to its POSIX sibling whenever Get-Command bash returns any command:

if (Get-Command bash -ErrorAction SilentlyContinue) { exit 0 }

Windows can expose the legacy WSL bash.exe launcher even when it cannot start a shell. This is the current state on my Windows 11 host:

Name   : bash.exe
Source : C:\WINDOWS\system32\bash.exe

bash --version
WSL ERROR: execvpe(/bin/bash) failed: No such file or directory
exit 1

I reproduced the shipped hook with an isolated missing MONK_AGENT_PATH and unused loopback port:

stdout_length=0
exit=0

The hook exits before its health check, binary check, or install-guidance JSON. I then added tests/antigravity-ensure-unusable-bash-stub.ps1, which puts a failing bash.cmd ahead of PATH, runs the exact shipped hook in a child Windows PowerShell process, and requires the normal monk-agent is not installed injectSteps payload. No real agent, network, OAuth state, or user data is involved.

Pristine v0.1.54 fails:

FAIL: unusable bash command made the native Antigravity hook exit without its install guidance; stdout=''

Expected behavior

The PowerShell hook should bow out only when the detected Bash command can actually start a shell. If the Windows/WSL launcher exists but is unusable, the native hook should continue and emit its normal running, start, or install-guidance JSON.

Actual behavior

Command discovery is treated as proof that the POSIX sibling can run. An unusable Windows bash.exe makes the native hook exit successfully with no stdout, so a cold invocation receives no guidance and the companion is not started.

I validated a minimal fix in PR #263: invoke the discovered Bash command with -lc "exit 0" while suppressing its output, and delegate only when it exits zero. The focused regression then passes and the updated PowerShell file parses with zero errors:

PASS: unusable bash command does not suppress the native Antigravity ensure hook
powershell_parse_errors=0

Collision check

I searched all repository issues (open and closed, limit 500) for Get-Command bash, bash.exe, WSL/no-distro, /bin/bash, unusable Bash, native-hook skip, and Antigravity PowerShell delegation.

#135 is the closest report but is not this failure. It covered the security-oriented block-monk hook selecting a runnable Bash whose .sh file then failed on CRLF line endings; it was closed after v0.1.52 forced LF endings. This report covers the non-security ensure-monk-agent lifecycle hook when the Bash command itself cannot start any shell, reproduces on current v0.1.54, and occurs before line endings or POSIX script contents are involved. #135's suggested improvements mentioned the presence-only weakness, but its shipped .gitattributes fix did not address this executable-liveness case.

No issue reports the current Windows/WSL stub condition suppressing Antigravity install/start guidance.

Severity (your guess)

major

The failure is silent and repeats on every cold model invocation: Antigravity receives neither a companion start nor the hook's actionable install guidance, while the hook exits successfully and therefore looks healthy to the host.

OS

Windows 11; system bash.exe present through WSL, but /bin/bash unavailable. Also reproduced with an isolated failing Bash-command fixture.

monkd version

Not involved; the defect occurs before companion/runtime access.

Target cloud

None; local Antigravity hook only.

Integration

Monk plugin for Antigravity on Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions