security: confine file commands and validate deep-link targets#57
Merged
Conversation
read_file/write_file/delete_file were unconstrained filesystem primitives reachable from the frontend and — via the quill:// deep link — indirectly from any web page. A crafted path could read /etc/passwd or overwrite an arbitrary file. - ensure_allowed_path confines the three commands to Markdown documents and their .comments.json sidecars, the only paths any legitimate caller uses. The native open/save dialogs already restrict the user to .md, so no real capability is lost. - parse_quill_open now resolves the decoded path and accepts it only if it canonicalizes to an existing regular .md/.markdown file (symlink re-checked), so a hostile quill://open?file=/etc/passwd can no longer coax Quill into touching arbitrary files. Adds unit coverage for the path policy, the confined commands, and deep-link target validation (existing file, missing file, non-Markdown target, directory-with-.md-suffix, wrong host). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sam-powers
added a commit
that referenced
this pull request
Jun 13, 2026
Documents Quill's security posture for a reviewing engineer: the threat model (deep link as the one attacker-influenced entry point; deserialized data trusted more than rendered data), the four merged hardening measures (#57 path confinement + deep-link validation, #58 annotation sanitization, #59 URL scheme allowlists, #60 binary-resolution hardening), and the two deliberate non-fixes left in place with rationale (asset-protocol $HOME/** scope, remote-image beacon). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Hardens the Tauri file-IO boundary, the most attacker-exposed surface in the app.
read_file/write_file/delete_filewere unconstrained filesystem primitives. They're reachable from the frontend and — through thequill://open?file=…deep link, which any web page can fire — indirectly from a hostile origin. A crafted path could read/etc/passwdor overwrite an arbitrary file.Changes
ensure_allowed_pathconfines the three commands to Markdown documents and their.comments.jsonsidecars — the only paths any legitimate caller ever uses. The native open/save dialogs already restrict the user to.md, so no real capability is lost.parse_quill_opennow resolves the decoded path and accepts it only if it canonicalizes to an existing regular.md/.markdownfile (symlink target re-checked). A hostilequill://open?file=/etc/passwdcan no longer reachread_fileat all.Tests
Five new unit tests (35 Rust tests total, all green): path policy accept/reject, the confined commands refusing disallowed paths, and deep-link validation across existing file / missing file / non-Markdown target / directory-with-
.md-suffix / wrong host.Full local bar green:
cargo fmt --check,cargo clippy -D warnings,cargo test, and vitest (231) via the pre-commit hook.🤖 Generated with Claude Code