Skip to content

W10 G0: lock-file link refusal, MCP argument bounds, min_lift maximum - #46

Merged
VirtualMachinist merged 3 commits into
mainfrom
feat/w10-nits
Oct 31, 2026
Merged

VirtualMachinist merged 3 commits into
mainfrom
feat/w10-nits

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

W10 gate G0: the four security-review nits from W9. Stacked series G0 to G3; this is the bottom PR, based on main 874b3eb.

  • Store (lock file): open_lock_file and open_existing refuse a symlink (dangling or not), a directory, a FIFO or any other non-regular file at the lock path. They check with symlink_metadata before opening and match (dev, ino) after, using std only. The refusal reuses the existing unsafe data-dir error, and its message names the role, never a path. tighten runs only on a verified file, lock_state reports the same refusal, and nothing is created or chmodded through a link.

  • MCP bounds: every string argument of every tool has maxLength, checked in the server before any store read and counted in Unicode scalar values:

    • against: 256;
    • file, repo, path and each focus item: 4096;
    • query, symbol, id, from, to, kind and detail: 1024.

    Over-length input gets the usage failure NAME is longer than N characters, with no echo.

  • min_lift: capped at 1000 in the CLI and MCP, with the message min_lift must be a number from 0 to 1000.

Every 874b3eb reply, error and tools/list entry stays byte-identical after removing the top-level meta, apart from the new bounds. No new package in Cargo.lock, no new crate, no unsafe, no new libc use.

Draft until the gate is graded, the checks are green and the security review clears the head.

🤖 Generated with Claude Code

VirtualMachinist and others added 2 commits October 30, 2026 19:19
Every string argument of every MCP tool, and each focus entry, declares
maxLength and is checked by the server before any store read, counted in
Unicode scalar values: against 256; file, repo, path and focus entries
4096; query, symbol, id, from, to, kind and detail 1024. A longer one is
the usage failure "NAME is longer than N characters", with no echo.

min_lift takes 0 to 1000 in the command line and MCP, with the shared
message "min_lift must be a number from 0 to 1000", and declares maximum
1000. README names the bounds under MCP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VirtualMachinist
VirtualMachinist marked this pull request as ready for review October 31, 2026 10:52
@VirtualMachinist
VirtualMachinist merged commit 3adff9e into main Oct 31, 2026
11 of 12 checks passed
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.

1 participant