Skip to content

Keep Lyra's files owner-only, gate destructive channels to the main window, and say what goes online. - #100

Merged
dillonstreator merged 5 commits into
mainfrom
fix/privacy-hardening
Nov 28, 2026
Merged

dillonstreator merged 5 commits into
mainfrom
fix/privacy-hardening

Conversation

@dillonstreator

Copy link
Copy Markdown
Member

Summary

Privacy, file permissions, IPC gating and documentation fixes from the 2026-11-28 audit: LYRA-PRIV-001, LYRA-CONS-003, LYRA-SEC-001, LYRA-PRIV-002 (docs), LYRA-PRIV-003, LYRA-OSS-001, LYRA-OSS-002, LYRA-DX-001 (docs only).

What was wrong

  • Other accounts could read your files (PRIV-001). Notes, recordings of other people, voiceprints, the search index and keys were created with the usual umask: files 0644, folders 0755. On a shared Linux machine with a traversable home folder, any other account could read every transcript and recording.
  • A power cut could empty your saved voices (CONS-003). voices.json and the key files were renamed into place without an fsync. A power cut right after a save could leave an empty voices.json, and every saved voice would be set aside.
  • The overlay could reach channels it never uses (SEC-001). The channels that delete sessions or people, or send transcripts to a cloud model (notes:generate, notes:backfill over every session), answered the overlay window too. This was a defence-in-depth gap, not a known exploit.
  • Deleted data lingered in the index (PRIV-003). A deleted person's voiceprints stayed in the search index's free pages.
  • Undisclosed licence and network use (OSS-001, PRIV-002). The opt-in local notes model is licensed for non-commercial use only, and the app never said so. The README's Privacy section left out model downloads and the GitHub update check.
  • Docs had drifted (OSS-002, DX-001).
    • THIRD_PARTY.md was missing the search model and the bundled fonts.
    • The threat model was out of date in a few places.
    • Nothing told users how to get past Gatekeeper or SmartScreen.

What changed

  • Permissions (privateFiles.ts, new; atomicFile.ts):
    • Atomic writes create files 0600 (the rename carries that mode over).
    • Session, audio, checkpoint, live-pass and index folders are created 0700. So is the notes folder when Lyra creates it.
    • New notes files are created 0600, and so are WAV files.
    • At startup, userData, .sessions and the default ~/.lyra are tightened to 0700 if other accounts could reach them.
    • A notes folder the user chose keeps its own permissions. Symlinks and folders owned by another account are left alone. Nothing changes on Windows.
  • Durable writes: voices.ts and secrets.ts use writeFileAtomic. The keys folder is created owner-only.
  • IPC gating: requireMainWindow moves to session.ts. These channels now refuse the overlay:
    • pages:save, pages:delete, pages:restore, pages:reveal
    • people:enroll, people:rename, people:setSelf, people:delete, people:restore
    • sessions:audio, recorder:start
    • notes:generate, notes:backfill
    • Not gated: what the overlay uses (session state, prompt answer, stop, show main, frames) and read-only or cancel channels.
  • Search index: PRAGMA secure_delete = ON.
  • Settings: the "On this computer" summary choice says it's for non-commercial use. Its notice names Qwen2.5 3B's non-commercial licence and links to it (an <a target="_blank">, which main hands to the OS browser).
  • Docs:
    • README Privacy: when Lyra goes online, that the update check can't be turned off yet, and file permissions. The README model list now includes the search model.
    • THIRD_PARTY.md: nomic-embed-text-v1.5 (Apache-2.0), the OFL fonts, and where the hashes are.
    • TROUBLESHOOTING: Gatekeeper, SmartScreen and gh attestation verify, plus a corrected note on where the hashes are.
    • THREAT-MODEL: the index and set-aside copies as assets, the permissions control, the gated channels, the update check as an accepted risk, and the removed "no licence allowlist" open item (security.yml runs check-licenses.mjs). It also corrects the "never a stack" line: an Error passed to log is written with its stack.

How it was tested

  • pnpm install --frozen-lockfile: OK.
  • pnpm check in apps/lyra (typecheck, lint, config:check, vitest): 87 files, 652 tests pass (646 on main).
  • New tests:
    • privateFiles.test.ts: folders created 0700; an existing 0755 folder is tightened once; symlinks and missing folders are left alone; nothing changes for win32.
    • atomicFile.test.ts: an existing 0644 file comes out 0600 after an atomic write. This fails on main.
    • db.test.ts: secure_delete is on.
  • The IPC gating has no unit test: the handlers need Electron. The UI smoke test drives these channels from the main window, so CI's smoke:ui shows they still answer it.
  • Not run: pnpm smoke and pnpm smoke:ui (they launch Electron; CI runs them). The website wasn't touched.

Needs manual verification

  • macOS/Linux: after upgrading, check that ls -ld ~/.lyra ~/.lyra/.sessions "<userData>" shows drwx------. Save a voice and an API key, and check the files are -rw-------.
  • Recording, deleting and restoring a session, and saving, renaming and deleting a person, all still work. These are the newly gated channels; the overlay pill only uses stop and show.
  • Settings → Summaries → On this computer: the hint and the notice read well, and "Read the licence" opens the browser.

For the reviewer to decide

  • Note files in a folder you chose are now 0600 when Lyra writes them. Previously they were 0644. Folders shared with a group on purpose would notice.
  • No setting to turn off the update check (PRIV-002). The add-setting rule says network features default off, but the update check is on today, so its default is a product call. The README and threat model now disclose it instead.

Left out

  • SUP-001 (minimumReleaseAge): this needs pnpm 10.16 or later, and the repo pins 10.15.1. Raising it is a toolchain upgrade.
  • DX-001 signing and notarization: this needs the owner's certificates. This PR adds the docs note only. The website download page wasn't changed.
  • SEC-002 (zod for the hand-checked channels) and SEC-003 (Windows autoInstallOnAppQuit): these are not in this PR. SEC-003 is an accepted risk and a product call.
  • The OSS-002 grep check: the suggested pnpm check grep that every ModelFile appears in THIRD_PARTY.md isn't added.
  • PR Name speakers from what was said, with the notes model. #98: the changes to meeting/notes.ts and meeting/pipeline.ts are a few lines in register*. They stay away from the hunks Name speakers from what was said, with the notes model. #98 touches.

Checks

  • pnpm typecheck (and the rest of pnpm check)
  • Changeset added (.changeset/private-files.md, patch)
  • pnpm smoke / pnpm smoke:ui: not run locally (CI runs them)
  • Stays local-first: nothing new leaves the device

- pages:save, pages:delete, pages:restore, pages:reveal, people:enroll/rename/setSelf/delete/
  restore, sessions:audio, recorder:start, notes:generate and notes:backfill now refuse the
  overlay, as settings, keys and the notes folder already did.
- requireMainWindow moves to session.ts beside isFromMainWindow.
…eir owner.

- Atomic writes create their file 0600; session, audio, checkpoint and index folders are
  created 0700, and the notes folder too when Lyra creates it (privateFiles.ts).
- At startup userData, .sessions and the default ~/.lyra are made 0700 if others could reach
  them; a notes folder the person chose keeps its own modes. Symlinks and folders another
  account owns are left alone. Nothing changes on Windows.
- voices.json and keys/<provider>.bin were renamed into place without an fsync, so a power cut
  could leave an empty file and every saved voice set aside. Both now use writeFileAtomic,
  and the keys folder is owner-only.
…al, and how to open an unsigned build.

- README Privacy: model downloads and the GitHub update check, which can't be turned off yet.
- Settings: the local summary choice and its notice name Qwen2.5 3B's non-commercial licence,
  with a link.
- THIRD_PARTY.md: the search model and the bundled fonts; where the hashes live.
- TROUBLESHOOTING: Gatekeeper, SmartScreen and gh attestation verify.
- THREAT-MODEL: the index, set-aside copies, file permissions, the gated channels, the update
  check, the licence allowlist (which exists) and what the log keeps of an Error.
@vercel

vercel Bot commented Nov 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lyra Ready Ready Preview Nov 28, 2026 7:19pm UTC

@dillonstreator
dillonstreator merged commit fcd0393 into main Nov 28, 2026
13 checks passed
@dillonstreator
dillonstreator deleted the fix/privacy-hardening branch November 28, 2026 20:32
@adavila0703 adavila0703 mentioned this pull request Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant