Skip to content

Harden vault auth and token handling for public release - #39

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/security-hardening-public-9b7f
Aug 9, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/security-hardening-public-9b7f

Conversation

@Modsofthenation

Copy link
Copy Markdown
Owner

Summary

Adversarial review before going public found unsafe vault defaults and several auth gaps on the loopback API.

Changes

  • Init: require an explicit password (min 8 chars); never fall back to workbench; seed demo data only when seed: true
  • Rate limit: lock unlock/destroy after repeated failures (15m window)
  • CORS: drop arbitrary *.localhost; allow only known Vite/Tauri origins
  • Tokens: constant-time compare for session + launch token; desktop .launch_token written 0600 on Unix
  • Downloads: shared authHeaders() so document/export fetches always send x-prm-launch-token in packaged desktop
  • Documents: confine readDocumentFile under the vault files/ tree
  • Sync folders: detect Dropbox/iCloud/OneDrive/Google Drive data dirs and surface a warning on status / unlock
  • Docs/MCP: clarify demo password is never a silent API/MCP default

Test plan

  • pnpm test (73 pass, including new authPolicy tests)
  • Create empty workspace without password → rejected
  • Create empty workspace with short password → rejected
  • Demo mode with workbench still works
  • After 8 failed unlocks → 429 until lockout clears
  • Packaged desktop: document download succeeds with launch token
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 9, 2026 11:49
Remove silent workbench/password and demo-seed defaults on init, enforce an
8-character minimum, and rate-limit unlock/destroy. Tighten CORS away from
arbitrary *.localhost, use constant-time token compares, confine document
reads under the vault files tree, and write the desktop launch token as
mode 0600. Share authHeaders across UI downloads so packaged desktop always
sends x-prm-launch-token. Warn when the data dir looks like a cloud sync
folder; clarify MCP/demo password docs.

Co-authored-by: Damon  <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@Modsofthenation, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 140b4118-bef4-4f1e-aea8-f60c31176f2b

📥 Commits

Reviewing files that changed from the base of the PR and between 393cb58 and 4a1014e.

📒 Files selected for processing (20)
  • .cursor/mcp.json.example
  • README.md
  • apps/api/src/authPolicy.test.ts
  • apps/api/src/authPolicy.ts
  • apps/api/src/index.ts
  • apps/api/src/store.ts
  • apps/desktop/src-tauri/Cargo.toml
  • apps/desktop/src-tauri/src/main.rs
  • apps/ui/src/lib/api.ts
  • apps/ui/src/lib/exports.ts
  • apps/ui/src/pages/PersonPage.tsx
  • apps/ui/src/pages/PromotionDetailPage.tsx
  • apps/ui/src/pages/RolesPage.tsx
  • apps/ui/src/pages/TeamPage.tsx
  • apps/ui/src/pages/UnlockPage.tsx
  • apps/ui/src/pages/WritingDeskPage.tsx
  • packages/mcp/README.md
  • packages/mcp/src/index.ts
  • packages/mcp/src/tools.ts
  • packages/shared/src/index.ts

Comment @coderabbitai help to get the list of available commands.

@Modsofthenation
Modsofthenation marked this pull request as ready for review August 9, 2026 11:51
@cursor
cursor Bot merged commit 9df35d6 into main Aug 9, 2026
3 checks passed
@cursor
cursor Bot deleted the cursor/security-hardening-public-9b7f branch August 9, 2026 11:52
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.

2 participants