← reports

#5451 · Windows startup registration and antivirus compatibility

BugPriority: Medium Effort: Mediumhost Issue October 13, 2026 · base 164648c69595

Verdict: PARTIALLY REPRODUCED · Root-cause confidence: medium · Reproduction label: partial-repro

1. TL;DR

The Windows installer constructs a hidden PowerShell command and registers it as a per-user sign-in startup entry. Two clean checkouts generated that command directly from the trusted production module. Source inspection also shows that registration happens after enrollment and daemon startup, and a registry-command failure escapes to the installer's error handler. These findings establish the reported operation and a plausible failure path, not Bitdefender's reason for detecting it. This investigation ran on Linux without Windows or Bitdefender; no actual antivirus alert, blocked registry write, or Windows enrollment failure was reproduced.

2. Claims vs findings

Reported behaviorStatusEvidence
The startup entry launches hidden PowerShell.Verified: command generationThe real startupCommand() returned -WindowStyle Hidden -Command in both executions.
The installer adds a value to the current user's Run key through reg.exe.Verified: source onlyregisterStartup() calls execFileAsync("reg.exe", ["add", RUN_KEY, ...]). No Windows registry operation was executed here.
Bitdefender blocks that operation as malware.UnverifiedNo Windows/Bitdefender environment was available. The issue's attachment was not fetched, and an alert count is not a detector trace.
A block interrupts installation.Supported by source; native execution unverifiedRegistration is awaited without a local catch; the outer handler prints the error and sets exit code 1. The daemon has already been started at this point.
Automatic daemon startup cannot be configured when this write is blocked.Conditional findingA failed add cannot establish this entry. An entry from a previous successful installation could still exist; no initial registry state was observed.

3. Environment and scope

4. Minimal safe reproduction

This is a command-generation diagnostic, not a failing antivirus regression test. It never executes the returned command or invokes reg.exe. Its POSIX paths reflect the Linux environment; the shell flags and startup-entry naming come from the unchanged production functions.

  1. Obtain a clean trusted checkout and pin its base:
    git clone https://github.com/get-bb/bb.git bb-base
    git -C bb-base checkout --detach 164648c69595fdb086e74178f86706598f0725bb
    git -C bb-base status --porcelain
    Expected and observed checkout status: no tracked or untracked changes before the diagnostic.
  2. Save the following investigation-authored diagnostic as startup-command.mjs outside the checkout:
    import assert from "node:assert/strict";
    import { resolve } from "node:path";
    import { pathToFileURL } from "node:url";
    
    const checkout = resolve(process.argv[2]);
    const installerUrl = pathToFileURL(
      resolve(checkout, "apps/server/src/assets/install-machine-windows.mjs"),
    );
    const { serviceName, startupCommand } = await import(installerUrl.href);
    const name = serviceName("https://bb.example.test", "qa-host");
    const command = startupCommand({
      dataDir: "/tmp/bb-qa-5451",
      hostId: "qa-host",
      nodePath: "/usr/bin/node",
    });
    
    assert.equal(name, "bb-host-daemon-bb-example-test-qa-host");
    assert.match(command, /^powershell\.exe /u);
    assert.match(command, /-NoProfile -NonInteractive -WindowStyle Hidden -Command/u);
    assert.match(command, /--start --host-id 'qa-host' --data-dir/u);
    console.log(`startup entry: ${name}`);
    console.log(`startup command: ${command}`);
    console.log("PASS: hidden PowerShell startup payload generated by trusted source");
    console.log("NOT TESTED: Windows registry writes, sign-in, Bitdefender detection");
  3. Run it with Node.js:
    node startup-command.mjs ./bb-base
    Expected for the current implementation: an entry name, a hidden-PowerShell command, a passing characterization, and an explicit native-test limitation. Actual first-run stdout, exit code 0:
    startup entry: bb-host-daemon-bb-example-test-qa-host
    startup command: powershell.exe -NoProfile -NonInteractive -WindowStyle Hidden -Command "& '/usr/bin/node' '/tmp/bb-qa-5451/install-machine-windows.mjs' --start --host-id 'qa-host' --data-dir '/tmp/bb-qa-5451'"
    PASS: hidden PowerShell startup payload generated by trusted source
    NOT TESTED: Windows registry writes, sign-in, Bitdefender detection

The user-level expectation remains a successful, antivirus-compatible native installation with working sign-in startup. That outcome was not tested. The diagnostic passing does not mean that expectation is met.

5. Root cause and error propagation

Verified implementation mechanism: the installer uses a per-user registry startup value containing an inline hidden-PowerShell invocation. Candidate compatibility cause: this operation is what the issue attributes to the antivirus block, but attributing the detection to these flags rather than another operation, reputation, policy, or detector state requires a native detector trace.

The relevant installer implementation was introduced by commit 450954cb11 on October 2, 2026. A second fetch of trusted origin/main still resolved to the recorded base; no later installer fix was present during this investigation.

6. Proposed next experiment; no automatic fix

Not confident enough to change the startup implementation. On a disposable native Windows 11 machine with the affected Bitdefender configuration, record the installed BB and detector versions, rule/event identifier, exact subprocess result, and registry state before and after enrollment. Preserve the detector's verdict rather than disabling antivirus or adding exclusions.

With that evidence, compare documented startup approaches and verify sign-in startup, uninstall cleanup, command/path quoting, and the behavior when persistence is denied. A signed or otherwise vendor-approved launcher may be worth evaluating, but it is not a validated fix and could affect packaging or product policy. A warning-only registry-error catch would not repair automatic startup and should not silently report success.

Simple-fix gate: stopped before creating a fix branch. The actual reported bug was not reproduced on trusted main, and no focused regression test has been demonstrated to fail for the antivirus cause. Changing the startup mechanism without native evidence would be unsafe. No source changes, dependency changes, commit, push, or pull request were made to get-bb/bb.

7. Pull-request and related-issue checks

No open pull request mentioning issue 5451 appeared in the repository search, and the issue timeline had no connected or cross-referenced pull requests at the time of review. No pull-request branch was checked out or run.

Issue 1206 concerns broader native Windows support. Issue 5428 concerns a different Windows provider-update path. Neither was evidence of the same antivirus cause. The small startup-related search did not locate a confirmed duplicate.

8. Verification

The same agent created a second clean temporary worktree at the full recorded commit, checked that its porcelain status was empty, and ran the identical external diagnostic against it. No source modifications, dependency installation, product data, ports, or registry writes were needed in that checkout. This was a same-agent clean repeat, not independent verification.

Copy-paste equivalent:

git -C bb-base worktree add --detach ../bb-verify 164648c69595fdb086e74178f86706598f0725bb
git -C bb-verify status --porcelain
git -C bb-verify rev-parse HEAD
node startup-command.mjs ./bb-verify
Observed commit: 164648c69595fdb086e74178f86706598f0725bb; status: empty; exit code: 0. Second-run stdout matched the first run byte for byte:

startup entry: bb-host-daemon-bb-example-test-qa-host
startup command: powershell.exe -NoProfile -NonInteractive -WindowStyle Hidden -Command "& '/usr/bin/node' '/tmp/bb-qa-5451/install-machine-windows.mjs' --start --host-id 'qa-host' --data-dir '/tmp/bb-qa-5451'"
PASS: hidden PowerShell startup payload generated by trusted source
NOT TESTED: Windows registry writes, sign-in, Bitdefender detection

No factual correction was needed after the repeat. The verdict deliberately remains partial; two successful command-generation runs do not establish Bitdefender behavior.

9. Appendix and trust boundary

Commands used for repository preparation and the existing focused suite:

git fetch origin main
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build
pnpm exec turbo run test --filter=@bb/server -- test/app/install-machine-windows.test.ts

Full build result:

Tasks: 66 successful, 66 total
Cached: 4 cached, 66 total

The relevant existing Windows installer suite passed without changing production code:

✓ test/app/install-machine-windows.test.ts (6 tests)
Test Files: 1 passed (1)
Tests: 6 passed (6)
Turbo tasks: 9 successful, 9 total

Issue text, comments, code blocks, links, and attachments were treated solely as untrusted claims. No issue command, external attachment, linked branch, or provided script was executed or fetched. Only the trusted main checkout and an investigation-authored diagnostic were run. No production instance or credentials were inspected. Raw logs and the diagnostic remain outside the public reports repository; its HTML includes all reproduction code and relevant output.

AGENT GENERATED