Skip to content

[Bug bounty] Windows bootstrap relies on unavailable IE parser in PowerShell 5.1 #195

Description

@qtcqtc

Bounty eligibility

  • I have signed up at monk.io with this GitHub account
  • I have used the product (installed the plugin and completed the Codex MCP login)
  • I have starred this repo

Stage

install

Coding agent

OpenAI Codex

Coding agent version

codex-cli 0.146.0-alpha.3.1

Repro steps

  1. Use a Windows host where the Monk plugin launcher runs under Windows PowerShell 5.1, as pinned by run-powershell.cmd.

  2. Use a Server Core image, or a fresh desktop profile where the Internet Explorer engine is unavailable or has not completed first-run setup.

  3. Start from plugin v0.1.52 (6bdde78) without an installed monk-agent.exe.

  4. Run:

    powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass `
      -File .\scripts\ensure-monk-agent.ps1
  5. Both download calls use Invoke-WebRequest -OutFile without -UseBasicParsing.

I reproduced the platform behavior deterministically with a regression harness that shadows Invoke-WebRequest with the documented headless-PowerShell failure and allows the request only when -UseBasicParsing is present. Against the unmodified v0.1.52 installer it fails immediately:

The response content cannot be parsed because the Internet Explorer engine is not available.

Expected behavior

The checksum and agent archive downloads should work under the stock Windows PowerShell 5.1 host without requiring Internet Explorer components, first-run setup, or an interactive desktop profile. The installer should verify the archive, extract monk-agent.exe, and return its installed path.

Actual behavior

Windows PowerShell 5.1 delegates web-response parsing to the Internet Explorer engine unless -UseBasicParsing is explicit. The installer therefore fails on headless/Server Core systems and affected fresh profiles before it can download the checksum or agent binary. monk-agent is never installed, so the Monk MCP tools cannot become available.

The launcher health probes already pass -UseBasicParsing; the two file downloads in all three shipped ensure-monk-agent.ps1 copies are the remaining gap.

I have a tested fix that adds -UseBasicParsing to both downloads and a PowerShell regression test that exercises the full checksum-download, archive-download, hash-verification, extraction, and install path. After the fix:

ensure_basic_parsing_status=pass downloads=2
Windows block-monk fallback tests passed.

Severity (your guess)

major

OS

Windows 11 Pro 10.0.26200, Windows PowerShell 5.1.26100.8875; also affects Windows Server Core / headless Windows PowerShell 5.1 environments

monkd version

Not installed: the failure occurs during the companion bootstrap before monk-agent can expose the Monk installation flow.

Target cloud

Local Windows bootstrap; no cloud provider selected.

Integration (if relevant)

OpenAI Codex + native Windows PowerShell 5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions