Security
Implemented controls, their limits and remaining assurance work.
Mouthtype is a single-user local dictation app, plus experimental Linux source and a static download website. Its meaningful boundaries are microphone capture, Accessibility-based text delivery, imported audio and local files, downloaded models, dependencies, and the signed release/update path. It isn't a hosted transcription service or a multi-tenant application. Developer benchmark modes can explicitly invoke a Claude CLI cleaner or judge; those modes can send their input to that service and must use synthetic data. The Mac app's Fast and Thorough cleanup paths use local models.
Implemented controls
Swift CodeQL runs on promotion PRs into main, pushes to main, and a weekly
snapshot of dev/v0.8.0. PRs into the dev branch report a skipped
Analyze (swift) job. Swift findings introduced there can remain undetected
until the weekly scan or promotion. Promotion analysis must pass before release.
The weekly dev checkout is uploaded against its actual dev revision. Scheduled
workflow changes take effect after reaching the default branch.
Manual CodeQL runs can select the standard Intel or ARM runner for measurements.
Swift builds use Xcode 26.6; ARM tracing requires Rosetta. Diagnostics retain build
logs, build plans and the finalized database's extracted first-party file list for
seven days. An extraction check fails if any Swift file under Sources/ is absent.
| Area | Control and evidence | Limit |
|---|---|---|
| Local data | Audio retention limits completed audio while preserving recoverable takes. Data is stored in the user's Application Support directory. | Text history is kept forever unless you set Keep text for. Retention is reapplied every six hours. Mouthtype doesn't encrypt its database, recordings or backups. |
| Destination safety | Insertion code rechecks focus at delivery, refuses secure destinations, retains text for recovery and skips automatic Return when focus moved since the take started or the starting field was unknown. Tests cover denied destinations and focus moves. | Accessibility behavior differs across apps. Clipboard reads don't prove insertion, and a partial paste may need manual repair. |
| Editor hints | Editor hints are off by default, run only in VS Code, Cursor, Xcode and supported terminals, and read the window title, the existing cursor-text window and git-tracked file names of one project. Tests cover the off state and that names stay out of stored history. | File names can be sensitive. They go only to the local recognizer, in memory for one dictation, and are never written or logged. A wrong tab or stale title can supply another project's names. |
| Names on screen | Names on screen is on by default, but only acts when Boost saved words (off by default) is on. It reads up to 2000 characters of the focused text field and the window title, never a secure field or terminal, within the same 150 ms bound, and sets AXManualAccessibility once per Electron app. Tests cover name extraction, secure-field exclusion, the deadline and the once-per-app flag. | Names from a message you were reading can be sensitive. They go only to the local recognizer, in memory for one dictation, and are never written or logged. The Electron flag makes that app build its Accessibility tree, which can cost it some CPU. |
| Imported audio | File transcription accepts one bounded supported file, preserves the original and requires explicit Copy or Save. | Decoding and inference use platform and dependency code. Resource bounds aren't proof that every parser defect is prevented. |
| Mac distribution | Release helpers require exact release identity, sign with Developer ID, notarize and verify the package. Public staging preserves versioned assets and creates the matching source archive and signed Sparkle feed. | Notarization isn't a security audit. Fresh-install and in-app upgrade acceptance must be verified separately for the release. Release signing signs and attests assets already attached to the release. It identifies the signing workflow; CI does not rebuild the assets or compare them with the tagged source. Releases are built in a repeatable mode whose unsigned contents match across checkouts except Assets.car. Signed and notarized output isn't bit-for-bit reproducible. No SLSA level or complete SBOM claim is made. |
| Update delivery | Updater uses the configured HTTPS feed and Sparkle signing identity. Installation waits for active app work. | Network requests reveal ordinary request metadata to hosting providers. Release signing credentials remain a maintainer responsibility. |
| Dependencies | Swift and npm lockfiles preserve resolved inputs. Dependabot proposes weekly Swift, website and docs-site npm, and Actions updates to the active dev branch. Free repository vulnerability alerts are enabled. | Updates and alert availability don't prove complete Swift advisory coverage. |
| CI authority | External Actions are SHA pinned, checkout credentials aren't persisted, jobs have timeouts and explicit permissions. Security checks need read access only. | Hosted runner labels and package repositories still evolve. Downloaded tool versions and container digests need separate maintenance. |
| Swift CI | The Swift workflow runs on pull requests and on pushes to main and dev branches. The build job compiles with -Xswiftc -warnings-as-errors. The test job runs the Swift tests with code coverage, then scripts/swift-coverage.sh enforces an 80% line floor. Both build and test are required status checks on main and dev branches. | Hosted CI skips two suites and one parameterized test that need a free desktop (SettingsKeyboardAccessTests, AppearancePreviewLiveTests and glassInAShownWindowOverEachSwatch). The full suite runs locally once at each dev-to-main release merge. The 0.7.0 merge ran 2,741 tests with no skips. Line coverage doesn't show the tests assert the right things. |
| Secret and workflow checks | Security CI runs full-history Gitleaks with redaction, actionlint, zizmor and the portable release-helper tests. The real ditto archive integration test runs on Mac and is explicitly skipped on Linux. Tool archives are SHA-256 verified before execution. scripts/swift-fuzz.sh runs libFuzzer with AddressSanitizer on the phrase matcher for 30 seconds. | Static checks have false negatives. The fuzz run covers the phrase matcher only. Zizmor runs offline, so audits requiring GitHub API metadata aren't included. |
| Website dependencies | Security CI uses npm audit --package-lock-only --audit-level=high, including development and transitive packages. Known advisories with no published fix can be waived in npm-audit-waivers.json; every entry must carry an expiry date, and it stops applying once the date passes or a fixed version is published. The separate website workflow builds and runs browser checks. | Advisory databases aren't complete; a clean audit isn't a guarantee. This check doesn't scan the apps/docs lockfile, Swift dependencies or downloaded model files. |
Linux client boundaries
The experimental Linux client and Omarchy plugin are source-only, with no supported desktop release. Physical Arch/Omarchy acceptance is still open, so these rows describe what the code does, not what a Linux machine has been shown to do.
| Area | Control and evidence | Limit |
|---|---|---|
| Imported audio decode | imports.py accepts one regular file up to 512 MiB, identifies the container with ffprobe (20 second deadline, report over 1 MiB refused) and allows WAV, AIFF and M4A (any MP4-family container with an audio stream passes as M4A, and only its first audio stream is decoded) up to 10 minutes. ffmpeg runs with no stdin, audio stream only, -t of 601 seconds and a 120 second deadline, in its own process group that is killed on cancel or timeout. It writes a new 0600 file, and the decoded WAV must be 16 kHz mono PCM16 with at most 600 seconds of frames. | ffprobe and ffmpeg are the distro packages parsing untrusted files, with no extra sandbox. The bounds limit resources, not parser defects. |
| Local cleanup server | Fast and Thorough run a pinned llama-server (worker.py) bound to 127.0.0.1 on a free port, with the web UI off. Before each load the worker checks the server reports the pinned revision, the service hashes the server and model against cleanup.json, and the worker confirms the server answers under a per-launch model alias. The service skips rehashing a model file whose path, size, mtime, inode, device and ctime still match a recorded passing check, with a full re-hash at least daily; MOUTHTYPE_VERIFY_FULL=1 forces it on every load. setup_cleanup.py builds the pinned llama.cpp revision from source and verifies each GGUF's SHA-256 against pins.json before placing it. | The server has no API key, so any process on the machine, including another user's, can send it requests while it runs. The port is chosen by binding and releasing a free one, so another local process could take it first; the alias check catches that. A worker watches its parent and kills its whole process group (including llama-server) within about half a second if the service dies, SIGKILL included. It stays loopback-only. |
| Clipboard paste and restore | paste delivery is opt-in. It checks the captured window is still the active, unlocked one, copies the text with wl-copy, waits for the clipboard to hold it and sends the paste chord to that window through Hyprland's send_shortcut dispatcher, or through untargeted wtype only if both dispatcher forms fail and the captured window is still active. Terminals get Ctrl+Shift+V, and text with a line break is refused for them unless allow_terminal_multiline is set. The clipboard's offered types are read first. A text clipboard (1 MiB, 1 second read) is put back after restore_delay_seconds (default 1.5, range 0.1 to 30) only if the clipboard still holds the pasted text. An image, file list or text over 1 MiB is never overwritten: the take stays in recovery as recover_only. A clipboard marked with x-kde-passwordManagerHint is overwritten but not restored. Phrases that use {clipboard} read it the same way. | Window identity is not field identity: secure-field detection and insertion read-back aren't available, so allow_unknown_secure_field is required. Helper success means the paste was requested, not received. During that window the transcript sits on the clipboard where clipboard managers can read it. A target that reads the clipboard later than the restore delay still pastes the earlier content. |
| Default login service | The Omarchy plugin installer writes a user unit, ~/.config/systemd/user/mouthtype-linux.service, wanted by and ordered after graphical-session.target, and enables it unless --no-autostart is passed or Launch at login is turned off from the menu. It refuses to overwrite a unit without the plugin's marker. The service runs as the user with no elevated rights and exits after 24 hours (Restart=always brings it back). Its socket is mode 0600 in a 0700 runtime directory. | The service restarts itself, so it can keep running across sessions until disabled. It records only after an explicit start command. |
| Hyprland bindings edit | Choosing a shortcut in the plugin edits ~/.config/hypr/bindings.lua inside a marked block, copies the original to bindings.lua.bak.mouthtype.<time> first, reloads Hyprland and restores the backup if hyprctl configerrors reports a problem. It refuses a key Hyprland already binds. | Backups accumulate and aren't pruned. The plugin's hold binding goes through control.py, which orders press and release. The raw examples in hyprland.lua, hyprland-legacy.conf and the client README no longer include a bare hold binding, because independent press and release clients have no ordering (audit finding F14); the plugin's control.py pair is shown commented out instead. |
The maintainer reviews findings, dependency advisories, tool pins and shipped behavior. Don't send real transcripts or recordings to scanners or review tools as test fixtures.
Verify a download
release-sign.yml signs every release asset with keyless cosign and attaches a .sigstore.json bundle next to each one. It also records a GitHub build provenance attestation. The workflow signs files already attached to the release. The signature and attestation identify the workflow that signed those bytes; they do not prove that CI built them or that they match the tagged source. Use Repeatable builds to compare a build from the tag. Download the asset and its bundle, then check both. This example uses the DMG, with X.Y.Z as the release version:
cosign verify-blob \
--bundle Mouthtype-X.Y.Z-macos-arm64.dmg.sigstore.json \
--certificate-identity-regexp '^https://github.com/CodesWhat/mouthtype/.github/workflows/release-sign.yml@refs/(heads/main|tags/v.+)$' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
Mouthtype-X.Y.Z-macos-arm64.dmg
gh attestation verify Mouthtype-X.Y.Z-macos-arm64.dmg --repo CodesWhat/mouthtypeApple notarization and the Sparkle EdDSA signature on the update ZIP remain what macOS and the updater check when you install or update. The cosign signature and attestation let you check a download independently of those. Release builds use the repeatable build mode, and each release manifest records it with the toolchain used. With the same source, toolchain and dependency versions, unsigned app contents match across checkouts except for Contents/Resources/Assets.car, which varies between builds. Signed and notarized output isn't bit-for-bit reproducible. The commands are also in RELEASING.md.
OpenSSF Scorecard
The Scorecard workflow runs the official Scorecard action on the default branch, weekly and on branch-protection changes. It publishes results to OpenSSF (the README badge reads them), uploads SARIF to code scanning and requests an OIDC credential for publishing only. It reports observations; no aggregate-score threshold substitutes for reviewing individual results and errors.
Note
The report can still contain unavailable checks because of API permissions or platform support. A successful process exit or artifact upload doesn't make those checks pass.
Workflow credentials have read access to the repository's code, checks, actions, issues and pull requests, plus security-events: write and id-token: write on the Scorecard job only, without administrative permission.
Note
CODEOWNERS requests review but doesn't enforce approval by itself. Required-review enforcement comes from the repository's branch protection or rulesets, which should be inspected directly rather than assumed.
Revisit the workflow's artifact retention and SARIF handling when the repository's visibility or plan changes. The reviewed development-branch release procedure remains the operating rule.
Assurance case
This section ties Mouthtype's security requirements to its threat model, design principles and the evidence in this repository. It doesn't claim the app is safe against a compromised Mac. The implemented controls above and the remaining work below are the detail behind it.
Security requirements
Mouthtype is meant to:
- keep recordings and transcripts on the user's Mac, with no audio sent over the network;
- never deliver text into a secure field, and never press Return automatically after focus moved since the take started or when the starting field was unknown;
- fetch only pinned speech and cleanup models (including the Whisper tokenizer, which is hash-checked), and install only updates signed with the project's Sparkle key;
- request the narrowest macOS permissions that make dictation work; and
- ship builds that are signed, notarized and traceable to a reviewed release.
Threat model and trust boundaries
The user is the only legitimate principal. Relevant threats are a malicious or malformed audio file, a changed upstream model repository or dependency, a tampered update or release asset, text landing in the wrong app or a password field, and a stray secret or real recording committed to the public repo. A person or process already controlling the user's account is out of scope, since it can read the same data and use the same Accessibility grant.
- Microphone to app. macOS microphone permission, with the
com.apple.security.device.audio-inputentitlement in Mouthtype.entitlements. It's the only entitlement requested. - App to destination app. Accessibility-based insertion in Insertion. The focus is rechecked at delivery. When the focused field is a secure field, nothing is pasted and the take keeps nothing: the transcript, word timings and search entry are erased and the recording is deleted, leaving only a stub row that every list and count leaves out. When system Secure Input is on but the field isn't confirmed to be a secure field, Delivery.swift still refuses to paste, but the take is kept as an ordinary one that didn't land, so it shows in Home and can be copied.
- Files and models to app. Imported audio is bounded and treated as untrusted. Models come from Hugging Face at exact commits in ModelPins.
- App to update server. Sparkle fetches the feed over HTTPS. Info.plist sets
SUPublicEDKeyandSURequireSignedFeed, and AppUpdater checks the configured feed URL. - App to a website you added. When you add a website to a Style list, SiteFaviconStore fetches its icon once:
GET https://<site>/to find the<link rel="icon">it names, then that icon, orhttps://<site>/favicon.icoas a fallback. Built-in sites (LinkedIn, Teams, Gmail and Outlook on the web) never get a request; they show a plain globe. Requests go only to the site you added: an icon link is followed only on that host or one of its subdomains, and a redirect to any other host is refused. They never go to a third-party icon service. They use an ephemeral session with no cookies, a 5 second timeout, at most 5 https redirects, a 256 KB body cap and a plainMouthtypeUser-Agent. The request reveals only the site name and your IP address to a site you chose to list. Icons are cached under~/Library/Caches/Mouthtype/SiteFaviconsfor 30 days, and a failure is remembered for a day so a render never retries. - Source to release. Pull requests into the dev branch, Security CI, and the release helpers that sign, notarize and verify.
Secure design principles applied
- Local first. Transcription and the Fast and Thorough cleanup paths run on-device. The only network use in the app targets is model download, update checks and website icons in the Style lists. None carries audio or transcripts.
- Least privilege. One entitlement, microphone input. Accessibility and input-monitoring access are requested for the features that need them and nothing else. build-app.sh signs with the hardened runtime. Editor hints are off by default and read only the minimum from supported editors.
- Fail safe. When the destination can't be verified, text isn't pasted. It's retained for recovery instead. A secure field gets neither: nothing is pasted and nothing is kept. If focus moved during the take, the text still pastes at the current focus, but automatic Return is skipped, as it is when the starting field was unknown.
- Data minimization. Audio retention caps completed audio by age and size. Editor hint file names stay in memory for one dictation.
- Supply-chain integrity. Lockfiles, exact model commits, SHA-pinned Actions, signed and notarized releases, and a signed update feed.
- Open review. Source is public under GPL-3.0, with a private reporting channel in SECURITY.md.
Countermeasures for common weakness classes
| Weakness class | Countermeasure | Evidence |
|---|---|---|
| Sensitive data exposure | No audio upload, bounded retention, editor hint names never persisted or logged, redacted secret scanning in CI. | AUDIO-RETENTION.md, EditorHintsTests, security.yml |
| Input into the wrong target | Focus snapshot recheck, secure-field refusal, no automatic Return after a focus move or from an unknown starting field, recoverable retained text. | Delivery.swift, TextInserterTests |
| Untrusted input parsing | Single bounded file, original preserved, results need explicit Copy or Save. Git file listings are capped at a byte limit, and a project's .git pointer file is followed only into a linked worktree or submodule git directory, checked as a path prefix of the real .git folder it sits in. | FILE-TRANSCRIPTION.md, ProjectFiles.swift |
| Tampered models or updates | Exact Hugging Face commit pins, bundled manifest check for offline cache adoption, EdDSA-signed feed required. | ModelPins.swift, Info.plist |
| Vulnerable dependencies | Lockfiles, weekly Dependabot, npm audit at high severity. | dependabot.yml, security.yml |
| CI and workflow abuse | SHA-pinned Actions, non-persisted checkout credentials, explicit minimal permissions, actionlint and zizmor. | workflows |
| Release tampering | Developer ID signing, hardened runtime, notarization, versioned public staging. | package-release.py, stage-public-release.py |
Residual risks
- Accessibility access is broad. A compromised Mac, or malware running as the user, can use it the same way Mouthtype does.
- Text history, recordings and backups aren't encrypted, and text history has no expiry unless you set Keep text for.
- Swift dependency advisories and downloaded model files aren't covered by automated scanning, and model files aren't hash-checked beyond what each library does.
- Hosted CI skips two suites and one parameterized test that need a free desktop, so they run only locally at each dev-to-main release merge. The source inventory described below does not establish complete binary composition. No SLSA level or independent third-party security review is claimed, and signed, notarized output isn't reproducible.
- Destination apps differ in how they handle Accessibility and paste, so a partial insertion can still need manual repair.
- Developer benchmark modes can send input to a Claude CLI and must use synthetic data.
These are tracked in the remaining work below.
Remaining assurance work
- Verify the first scheduled Dependabot processing and Scorecard report. Dependabot opened its first updates against the dev branch in October 2026 (#464, #468), and Scorecard reports 8.2 for main at
d07aa34. - Triage the two open Scorecard findings (2026-10-31). Alert #4, Maintained, reports that the repository was created within the last 90 days; GitHub records creation on 2026-10-12. Reassess after the age window instead of adding activity to change the score. Alert #3, Code-Review, found 7 of 15 sampled changesets with recorded approvals. Dev PRs use a manually requested CodeRabbit review, which is not the same as a recorded human approval; main's rules require two approvals, code-owner review, approval after the last push and resolved review threads. Keep those controls. Both alerts remain visible as posture findings; triage does not make the observations disappear.
- MLX cleanup models are pinned to exact Hugging Face commits in
CleanerCatalog, so a changed upstream repo isn't picked up by a fresh download. - Speech models are pinned to exact Hugging Face commits in ModelPins, the single place to read or bump them. Parakeet v3 (
FluidInference/parakeet-tdt-0.6b-v3-coremlat7dd20fe6b1797d35f5e3307e8b1732d9a178edfe), Parakeet v2 (FluidInference/parakeet-tdt-0.6b-v2-coremlatee09c569f73759e6d44c9bd16766f477b2b36d39), the CTC-110M vocabulary model (FluidInference/parakeet-ctc-110m-coremlataccdafd8cf8a2ff1cabe3c11e54416b405d409aa), Silero VAD (FluidInference/silero-vad-coremlatb419383c55c110e2c9271fa6ee0ea83d03c70d96) and WhisperKit (argmaxinc/whisperkit-coremlat0f63a7800b00dd0226abd051b906c246e1907482). FluidAudio takes its pins throughModelRegistry.revisionOverrides. WhisperKit 1.1.1'sWhisperKit.downloadhas no revision parameter, soWhisperModelFetchruns the same variant lookup throughHubApiWrapper, which does. The two shipped variants skip that lookup.ModelPinslists every file in each one's folder at the pin, and when all of them are cached with a Hub download record naming the pinned commit, the folder loads with no request, so a relaunch works offline. A missing file, a missing record or a record from another commit sends it to the pinned snapshot of that exact folder, so a pin bump re-downloads instead of loading the old cache. If the cache still doesn't match the pin after that snapshot, which is what happens offline right after a pin bump, the load fails and asks for a connection. The cached model files aren't re-hashed at launch. Files are not hash-checked beyond what each library does, except the Whisper tokenizer. WhisperKit has no tokenizer in the pinned CoreML folder and would fetch one from Hugging Facemainwith no digest check, soWhisperTokenizerFetchgetsconfig.json,tokenizer.jsonandtokenizer_config.jsonitself at exact commits (openai/whisper-large-v3at06f233fe06e710322aca913c1bc4249a0d71fce1for the turbo model,openai/whisper-small.enate8727524f962ee844a7319d92be39ac1bd25655a), checks each against a SHA-256 recorded inModelPins, and keeps them in a folder named for the commit. Cached copies are re-hashed on every load, so an offline launch works from a good cache and a changed file is refetched. Anything that doesn't match, or won't parse, fails the load instead of reachingmain. WhisperKit is pointed at that folder as its tokenizer folder. FluidAudio's fallback fetch of a missing Parakeet vocabulary JSON still resolvesmain, and a pin bump re-downloads the model once. Caches that predate the pins have no FluidAudio revision marker. FluidAudio adopts those itself when it can fetch the pinned file listing, so online they aren't re-downloaded. For a first launch with no network,ModelCacheAdoptionchecks the cache against a manifest bundled with the app (ModelManifest.json, generated at the pinned commits byscripts/generate-model-manifest.py) and writes the marker only if every required file is present and matches and no.partialfile is left. Anything else is left for FluidAudio's own adoption or download. - Establish automated Swift advisory coverage for the actual resolved packages and model supply chain. Until then, review upstream advisories and package changes before release; npm auditing doesn't cover them.
- Swift builds with warnings as errors and runs tests with an 80% line coverage floor on a hosted macOS runner, as required checks. The desktop-dependent tests still run only locally at release merge.
- Release assets carry a cosign signature and a GitHub build provenance attestation (see Verify a download).
- Publish a verified release source inventory. The helper binds the tag's exact resolved Swift source revisions to checksum-verified release ZIP and DMG identities, in CycloneDX 1.6 with incomplete composition declared. It does not establish which package products were linked or cover downloaded models and system libraries. No inventory is published yet.
- SLSA decision: claim no Build L1 or higher for the current Mac distribution. SLSA's build track requires provenance describing the build; the current hosted workflow signs and attests previously uploaded bytes without running that build. Keep this limit explicit until provenance is generated by the actual build process and checked against the relevant requirements. A GitHub attestation alone does not establish a SLSA level.
- Get an independent third-party security review. None has happened.
- Keep physical installation, updates, permissions, microphone routing and destination-app acceptance in the release checks. Static scanner results don't replace them.
These are maintainer follow-ups, not claims that the repository has achieved a target Scorecard score or an OpenSSF Best Practices level above passing. See SECURITY.md for supported releases and sensitive reporting.