Repository navigation
Closed
Labels
area:productWork in the product area.priority:P2Important quality, usability, or hardening work.type:securitySecurity, supply-chain, privacy, or network-safety work.
Description
Batch 5's audit of rvt-mcp (main at e57db42), three slices, each finding confirmed by a second reader. The common thread: answers and server memory are sized by the file or the client with no byte cap, and file text reaches the client's model with nothing marking it as file content.
Answer size and memory
list_rooms(views.rs:731, handlerserver.rs:380) has no page or limit: every space, twice (structured content plus the same JSON as a text block).list_elementsis capped at 1,000 rows (server.rs:287); this one is not. (medium)list_elementsrows carry file strings with no length cap (views.rs:148), so 1,000 rows can be arbitrarily large.- The whole diagnostics document is returned inline (
views.rs:295,exports.rs:121-125). max_open_modelstruncates the retained list (store.rs:521) but concurrent calls each decode a model before that (store.rs:327), so N concurrent opens decode N models.export_gltfbuilds the whole GLB in memory plus copies of its binary chunk (exports.rs:219-221), whereexport_ifcstreams.- The phase string a client sends, and file-derived phase lists on the error path, are retained up to 64 copies with no byte cap (
store.rs:468-469). - Progress events queue without a cap when the client reads slowly; the 250 ms throttle applies to sending, not queueing (
server.rs:106).
Arguments
limitis bounded only in prose: the schema isOption<u32>(args.rs:53-54), over 1,000 is silently clamped and0returns one row (server.rs:287). Fix: stateminimum/maximumin the schema and treat 0 as 0 or an error.- A file whose modification time cannot be read becomes
0in the model's identity (store.rs:97-101), which weakens the "file changed since opened" check.
File text as content
- Element names, parameter values and messages quoting them reach the client verbatim (
views.rs:42,:148,:378,:706;exports.rs:64-66). JSON escaping keeps them inside strings, but a crafted model can still place text shaped as instructions where the client's model reads an answer. Fix direction: a per-field length cap, and a note in the tool descriptions that names, values and messages are file content.
Defaults to decide (documented behaviour, not bugs)
- Reads are not confined (
store.rs:476), and writes are confined only when--output-diris given (output.rs:85,:117). Both are stated indocs/mcp.md:11-13. Whether the server should default to the folder it was started in is a product call; it is recorded here, not changed.
No export moves. Contract tests in tests/ cover the tool shapes; a schema change to limit updates docs/schemas/ and the rendered tool list (tools/ci/render-mcp-tools.py).
Metadata
Metadata
Assignees
Labels
area:productWork in the product area.priority:P2Important quality, usability, or hardening work.type:securitySecurity, supply-chain, privacy, or network-safety work.
Activity
fix(mcp): summary_answer hands the store, not its clone, to the answe…
docs(mcp): the tool contract as the server writes it, from CI run 433…
fix(mcp): list_rooms gives 1000 spaces by default, the diagnostics ar…
docs(mcp): the tool contract as the server writes it, from CI run 433…
DrunkOnJava commentedon Nov 13, 2026
Decision on item 11 (the server's default reach), from the maintainer, 2026-11-13: confine reads and writes to one folder by default.
rvt-mcpopens and writes files only inside one root folder: the folder it is started in, unless the setup names another. A flag widens it for anyone who needs that. Today it reads anything the account can read and writes anywhere without--output-dir(docs/mcp.md:11-13). Item 10 is why the default matters: a crafted model's text reaches the client's model unmarked and could steer it into opening or overwriting files outside the project.What a fix needs:
store.rs:476) and writes (output.rs:85,:117), compared after canonicalising so..and symlinks cannot leave it;docs/mcp.mdand the tool descriptions;test(ifc): write_glb_to writes the bytes write_glb writes, with the f…
DrunkOnJava commentedon Nov 13, 2026
Refinement of the folder decision above, so the default protects something whatever the client does. An MCP client chooses the server's working directory, and some start their servers from
/(Claude Desktop on macOS has been reported to). "The folder it is started in" would then be the whole disk.--root <folder>argument, or an environment variable for clients that pass only those. The decision's words were "the folder you pick, ... when you set it up"./, a drive root such asC:\), not the user's home folder, and not a parent of the home folder. Otherwise it starts, but every tool that touches a file refuses with a message naming--root, so the client shows the user what to set.--root /), so reaching the whole disk is always something someone typed.fix(mcp): answers and text from the file are bounded, concurrent open…
fix(mcp): the root's tests name their home folder /people/alex, which…
fix(mcp): main.rs names the root module it declares, not a second imp…
docs(mcp): the tool contract as the server writes it, from CI run 434…
fix(mcp): a root and an output folder reached through a link take pat…
test(mcp): the helper that sets environment variables is Unix-only, a…
fix(mcp): the server reads models from, and writes exports to, one fo…
DrunkOnJava commentedon Nov 13, 2026
All eleven items are on main: items 1 to 10 as #1897 (cdd5f5d: field and answer bounds, the gate for concurrent opens, the streamed GLB, the capped progress queue, paged
list_rooms, thelimitrange, the modification time, file text marked as data in the tool descriptions), and item 11, the product call, as #1900 following Griffin's decision on this issue: the server reads from and writes to one root folder that its setup picks (--root,RVT_MCP_ROOT, or the folder it was started in unless that is/, the home folder or a folder above it),--unconfinedlifts the limit, and docs/mcp.md has the upgrade note.