Documented --allow-dir / MCP_PDF_ALLOWED_DIRS filesystem allowlist is not implemented in the pure-Rust server
Description
SECURITY.md and docs/api/index.md instruct operators to restrict filesystem reach with --allow-dir=<path> or MCP_PDF_ALLOWED_DIRS, but the pure-Rust server did not implement either name. The flags were accepted silently and had no effect: the server read any PDF the process had OS permission to open, with no warning. An operator following the hardening checklist believed filesystem access was scoped when it was not.
Affected
@sylphx/citra and @sylphx/pdf-reader-mcp on the pure-Rust engine before the fix.
Patched
Implemented and verified against the published artifact. The binary now accepts the flag:
Usage: citra-mcp-server [doctor] [--allow-dir=<path>]...
--allow-dir=<path> Restrict local PDFs to this directory (repeatable)
MCP_PDF_ALLOWED_DIRS Platform path-list of allowed directoriesand refuses reads outside the configured set:
$ citra-mcp-server --allow-dir=/tmp/allowtest/allowed
{"jsonrpc":"2.0","id":2,"error":{"code":-32602,
"message":"Access denied: path '/tmp/allowtest/outside/secret.pdf'
is outside the configured allowed directories."}}The same call without the flag proceeds to parse the file, so the flag is what makes the difference. Verified on @sylphx/citra-linux-x64-gnu@5.0.2; the first release carrying the fix is @sylphx/citra@5.0.2.
Credit
Reported by the reporter credited below.