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.

Original post →

More from coding & agent

coding & agent channel →