Skip to content

fix: engine hardening for git sources, permissions, pairing links, the sandbox, the built-in browser, tool processes, connectors, skills and Windows agent starts - #15

Merged
nodemode-ai merged 16 commits into
mainfrom
fix/review-2026-11-28
Nov 29, 2026

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Plugin and marketplace git sources: a URL, ref or sha that starts with - is refused, the URL is passed after --, and every git call runs with protocol.ext.allow=never.
  • Other devices: the pairing link and QR code are returned only to the FormAT window. REST and MCP callers get null for both.
  • macOS sandbox: the sandbox-exec profile also denies lsopen, appleevent-send and the LaunchServices lookups, so a sandboxed command cannot start an app outside the sandbox.
  • Built-in browser: it does not open FormAT's own engine, window or devices addresses. Hosts are read the way the browser reads them (numeric and short IPv4 forms, hex, octal, IPv4-mapped IPv6, percent escapes, full-width characters, and names that resolve to this computer). Loopback requests carry a marker header, and the engine refuses any request that carries it.
  • Bash tool: running commands are tracked and ended at engine shutdown. On Windows the whole process tree is ended with taskkill /T. On macOS and Linux the whole process group gets SIGTERM, then SIGKILL for anything still running after 3 seconds.
  • Connectors: a token refresh that fails on a network error, 429 or 5xx keeps the sign-in. Only a refusal from the server signs the connector out.
  • Skills: a new copy is staged and swapped in only once it is complete, so a failed copy leaves the existing skill unchanged.
  • Windows agent starts (shared finder version 1.0.2): npm, pnpm and bun .cmd shims are resolved to their .exe, or to node and their script, and run without cmd.exe. Any other shim runs through cmd.exe /d only when every argument is plain.
  • Each change has tests in backend/tests. The backend HASHOUT log records the changes.
  • Windows agent start: a shim that is not of the npm, pnpm or bun kind goes through cmd.exe only when no word, the program's path included, holds & | < > ^ ( ) ! % " or a control character, with or without spaces. Otherwise the start is refused with a message pointing to stdin or a file.
  • A .cmd or .bat name with trailing dots or spaces, in any letter case, is handled as a shim.
  • Shared agent finder 1.0.2: the recorded hash is updated for the stricter rule; the version number is unchanged.
  • New tests cover both Windows start paths, the shim run directly and the cmd.exe fallback, and run on any OS.

Tests

  • Each fix has a test that fails on the previous code where practical.
  • The repo CI commands were run locally on macOS. Every failure seen locally also fails on main in the same environment (missing local tools or platform-specific tests); none is introduced here.
  • Please rely on this PR's CI run for Linux and Windows.

For the owner

  • A few related items need an owner decision; they are listed separately, not here.

How to ship

  • Independent of other repos; merge in any order. No version bump; release as usual.

…possible

The shared finder moves to version 1.0.2. A .cmd or .bat shim is replaced by the program it starts; any other shim goes through cmd.exe only when every argument is plain.
…shim start

Quoting does not protect an argument that a .cmd shim reads again through %*, so any word holding & | < > ^ ( ) ! % " or a control character is refused whether or not it has spaces. A name ending in .cmd or .bat with trailing dots or spaces is treated as a shim. The hash recorded for finder version 1.0.2 is updated.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:17
On a machine with bubblewrap, as the CI runner has, the bash tool ran each test command in bwrap, whose empty /tmp hid the stand-in shell the test setup puts in SHELL, so no command started and the SIGTERM test found no pid file. bwrap's own pid namespace would also hide the child's real pid. An autouse fixture sets sandbox.kind to None for this file, as test_sandbox_profile.py already sets kind itself. The backend HASHOUT log records why. Checked with python -m pytest tests with bwrap installed: 233 passed, 1 skipped.
@nodemode-ai
nodemode-ai merged commit dced185 into main Nov 29, 2026
5 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants