Pure-Rust CDP MCP Ships Fail-Closed File Upload, Catches Two P1 Bugs in Review
Wasabigz · reddit · 2026-12-02
The author shipped native browserfileupload in sessfork-mcp, a 913 KiB zero-Node.js pure-Rust CDP MCP server, to close a quiet security hole: browser MCPs sharing --output-dir between exported storageState (cookies/JWTs) and uploads let one prompt-injected page exfiltrate auth state.
Four hard guardrails: fail-closed by default (uploads require explicit --upload-root); credential denylist evaluated before allowlist (.sessfork, --output-dir, --storage-state unconditionally blocked after fs::canonicalize(), with opaque errors to prevent existence oracles); configurable size cap (default 100 MiB) checked post-allowlist, receipts return basenames only; native CDP DOM.setFileInputFiles with no base64 bloat and isTrusted: true events.
Two real P1 bugs caught in review: Windows' \\?\ verbatim prefix from canonicalize breaks downstream CDP path consumers; and in a Python helper, str implements Sequence, so passing "/tmp/docs" iterated character-by-character into --upload-root=/, while whitespace resolved to Path.cwd() — fixed with explicit type/whitespace/NUL guards.
Paired operational pattern: point --upload-root at an empty-by-default 0700 staging dir wiped after each task. 48 Rust + 52 Python tests, MIT licensed.
More from coding & agent
- Running crons via Grok Bot with day-long notifications makes each job 100x more useful — gaganghotra_ · 2026-12-06
- JetBrains runs 500k context on a 16GB GPU with two-tier Q8 KV cache — yogthos · 2026-12-06
- Agent-native GTM teams need full-stack plus agent engineering, LangChain job post shows — BraceSproul · 2026-12-06
- Cohere Team to Host NeurIPS Panel on Shipping Frontier Research into Regulated Industries — Julianfmack · 2026-12-06
- Agentic commerce in action: snap a QR code and your agent pays for parking and donations — jeff_weinstein · 2026-12-06
- Voice agent dev: even fastest LLM API leaves laggy responses, users hang up — FalseSort5750 · 2026-12-06