This document is the contract MacCV's security claims are held to. It exists because those claims are easy to state loosely and hard to verify, and because a privacy claim a user cannot check is worse than no claim at all.
Every statement here is either enforced by code with a test, or explicitly marked as not enforced with the reason. Where macOS imposes a hard limit, that limit is recorded rather than worked around.
Enforced. MacCV performs no network I/O except update checks.
- The only network calls in the codebase are in
crates/maccv-core/src/updater.rs, and all of them go throughcurl_to_string/curl_to_file. - Those two functions are the sole call sites of
/usr/bin/curl. Verified byScripts/checks/no_undeclared_network.py, which greps for process spawns and fails on any binary other than the allowlisted ones. - Clipboard content is never passed to any of those functions. The update path handles only URLs, digests and version strings that came from the feed.
Allowed network destinations, exhaustively:
| Destination | Purpose | When |
|---|---|---|
yxxbc.github.io |
release feeds | update check only |
github.com |
release assets | update download only |
gh-proxy.com |
mirror of the above | only after the canonical host failed |
An update check happens when the user asks, or on a policy the user chose. The
manual policy performs no background check at all.
Partly enforced; the limit is documented rather than hidden.
Clipboard content reaches exactly one shared channel on macOS: the system pasteboard. It is world-readable by design. There is no API to write to it privately, and this is a platform limit rather than an implementation choice:
NSPasteboardContentsOptionsCurrentHostOnlyrestricts device synchronisation, not other applications.- AppKit has no
concealedortransienttype.org.nspasteboard.ConcealedTypeis a third-party convention honoured only voluntarily. NSPasteboardAccessBehavior(macOS 15.4+) describes whether this process may read. It cannot restrict anyone else.
Therefore:
- History is held in memory only and never written to disk, so other
applications cannot read the log. Nothing in
maccv-coreopens a file for clipboard content. - A paste writes one entry to the pasteboard and leaves it there, exactly like ⌘C in any application.
- Paste Without Clipboard (
secure_input.rs) is the only mechanism that keeps content out of the shared channel: it delivers the text as synthetic keystrokes addressed to the frontmost application, so no other process can observe it. This is a real guarantee and it is the reason the feature exists.
Not enforced: the content of a clipboard write is visible to other applications. Nothing can change that. Users who need the guarantee must use Paste Without Clipboard.
Enforced by absence. MacCV contains no AI, ML, analytics, telemetry or crash reporting of any kind.
- No model inference, local or remote.
- No SDK for any such service in
Cargo.tomlorproject.yml. - No usage statistics, no identifier, no ping.
Verified by Scripts/checks/no_undeclared_network.py, which fails if a dependency
list introduces a known analytics or AI host, and by the network allowlist in S1.1.
This must remain true. It is recorded here so a future contributor adding "just crash reporting" knows the answer is no, and why.
Enforced by construction. History lives in ClipboardStore.history, a Swift
array. There is no serialisation of it anywhere.
- No
write(to:), noFileManagerwrite, noUserDefaultsentry for content. AppSettingspersists preferences only — booleans, an integer, a language code.Scripts/checks/no_content_persistence.pyasserts that the settings type has no field that could hold clipboard content.
When on-disk history arrives, it goes in the app container, and this section gets a new subsection describing the format, the retention rule and the clearing behaviour, rather than being quietly relaxed.
Status: design phase. No plugin system exists yet, and this section is not a description of shipped behaviour.
The requirement is that a plugin cannot break the host's security. That requirement constrains the design, so the design is recorded before any code.
A plugin loaded as a dynamic library into the app's process is indistinguishable from the app itself to the operating system. It can read the clipboard history, open a socket, read the Keychain, or crash the host. "Plugins cannot break security" is not achievable this way — it would be a promise with nothing behind it, and this document does not record promises.
Native code, isolated in an XPC service:
| Aspect | Choice | Why |
|---|---|---|
| Language | Swift or Rust, compiled to a dylib | Performance: this is the requirement that ruled out WASM |
| Execution | loaded into a separate XPC service process | a plugin crash kills the helper, not the app |
| Data access | host passes only what the plugin's manifest declares | capability model, not ambient authority |
| Network | helper has no entitlement for it | enforced by the sandbox, not by convention |
| Filesystem | helper has no writable container | same |
| Time and memory | host enforces a per-invocation budget | a plugin cannot wedge the app |
The capability model is the load-bearing part. A plugin declares what it needs:
# plugin manifest
[capabilities]
read_clipboard_item = true # the current entry only
write_clipboard = false
network = false # unavailable regardless; declared for clarityThe host grants what is declared and nothing else. A plugin that declares nothing gets nothing.
Stated plainly so the eventual documentation does not overclaim:
- The helper can read what it is given. A capability to read one clipboard entry means that entry is in the helper's memory. A malicious plugin can exfiltrate it if it also has network access — which the sandbox denies, and that denial is the actual control.
- A plugin cannot be prevented from being slow within its budget. It can waste the budget; it cannot exceed it.
- Signing is not yet specified. Without it, installing a plugin is trusting its author.
- XPC isolation is not a security boundary against a kernel exploit. It is a boundary against a plugin doing something the user did not intend.
Any change that widens what a plugin can reach must answer all of these in the pull request:
- Which capability does this expose, and is it opt-in per plugin?
- What is the smallest data that satisfies it? (Not "the snapshot" when "the preview string" would do.)
- Does the helper gain an entitlement? If yes, this needs review by someone other than the author.
- What happens when the plugin misbehaves — crash, hang, huge allocation?
- Is there a test that a plugin without the capability cannot reach the data?
Enforced. An update is installed only after, in this order:
- SHA-256 of the download matches the feed. A mismatch deletes the file.
- Code signature validates under
spctl --assess --type execute. - Only then is
com.apple.quarantinecleared.
The order is the control. Clearing the attribute before verification would defeat it, since the attribute is the one thing distinguishing "the user downloaded this" from "something placed this here".
Deliberate limits:
- The feed is fetched over HTTPS from the project's own host. A hash proves the bytes match what the feed promised; it does not prove the feed was honest. The mirror is therefore tried second, never first.
- The mirror is used only for GitHub hosts. A feed pointing anywhere else is never mirrored, so its traffic cannot be routed through a third party.
- MacCV does not replace its own running bundle. A verified, de-quarantined bundle is revealed in Finder and the user completes the swap.
- Not notarized yet.
spctlwill accept a Developer ID signature but Gatekeeper still prompts on first launch. Recorded in the roadmap.
A released version can be withdrawn by adding it to the feed's revoked array.
When the running version appears there, UpdateStatus::Revoked is returned,
maccv_update_result_is_forced is true, and the app shows a window that cannot be
dismissed except by updating or quitting.
It does not terminate the process — a user with unsaved work elsewhere should be able to finish — and it does not update silently, because being forced to update with no explanation is indistinguishable from malware. See RELEASING.md for the emergency procedure.
Enforced. Every entry point validates its pointers and returns a status code.
A panic across the FFI boundary would be undefined behaviour, and release builds use
panic = "abort", so this is a crash-prevention requirement rather than a style
preference.
- Null pointers return
MACCV_ERROR_NULL_POINTER, never dereference. - Invalid UTF-8 returns
MACCV_ERROR_INVALID_UTF8. tests::null_pointers_are_reported_not_trappedcovers each entry point.
Enforced. Anything on the pasteboard was written by another process and may be hostile.
- Type identifiers and payloads are length-tagged, never NUL-terminated, so an embedded NUL cannot truncate a value.
- Strings handed to C have interior NULs replaced rather than being dropped.
- Every detector in
redaction.rswalks characters, not bytes, so multi-byte text cannot cause a slice to panic. Four separate bugs of exactly this kind were found by the test suite before release. - The single-free contract is tested: a snapshot with empty optional fields releases
without touching static memory. A
const-based sentinel previously made that comparison fail and crashed on every failed update check.
Enforced. CGEventPost to the HID tap requires the Accessibility permission.
Without it the engine returns AccessDenied rather than appearing to succeed, and the
UI disables the feature instead of offering an action that silently does nothing.
Recorded so these are decisions rather than oversights.
| Not done | Why |
|---|---|
| Storing history on disk (yet) | Removes a whole class of exposure until the format and retention rule are designed |
| Sandboxing the app | The app must read the pasteboard; the sandbox would not change what it can see |
NSVisualEffectView behind content |
Visual only, but it also renders clipboard content into a composited layer |
| Any analytics | S1.3 |
| Auto-replacing the running bundle | A half-completed swap is worse than a manual drag |
| Silent forced updates | S3.1 |
| Claiming redaction is a security boundary | It is a display and storage measure; text detection is inherently incomplete |
These invariants are checked by:
Scripts/verify.sh # everything
python3 Scripts/checks/no_undeclared_network.py
python3 Scripts/checks/no_content_persistence.py
cargo test -p maccv-core # redaction, updater, pasteboard
cargo test -p maccv-ffi # pointer validation, single-freeA change that weakens any invariant in this document requires updating the document in the same pull request, and saying why.