Skip to content

fix: reject any passphrase when vault is initialized but empty (#837)#856

Open
saurabhhhcodes wants to merge 1 commit into
shouri123:mainfrom
saurabhhhcodes:fix/vault-passphrase-verification-837
Open

fix: reject any passphrase when vault is initialized but empty (#837)#856
saurabhhhcodes wants to merge 1 commit into
shouri123:mainfrom
saurabhhhcodes:fix/vault-passphrase-verification-837

Conversation

@saurabhhhcodes

Copy link
Copy Markdown

Problem

unlockCredentials() in src/utils/credentials.ts has a critical security flaw: when the vault is initialized (salt is stored) but no credentials have been saved yet, the passphrase verification block is skipped entirely, and any passphrase is accepted.

This creates a silent irreversible lock-out: if the wrong passphrase is accepted, subsequent saves encrypt with a derived key that the real passphrase cannot decrypt, permanently locking the user out of their credentials.

Root cause

The verification only ran when encryptedCreds was non-empty (i.e., at least one API key had been stored). With an empty vault, the code fell through to return true without checking the passphrase.

Fix

  • Introduces a VAULT_VERIFICATION_KEY storage key
  • During first-time setup, stores an encrypted verification token alongside the salt
  • During unlock, always attempts to decrypt the verification token (falling back to credential-based verification for backwards compatibility with existing vaults)
  • Any decryption failure rejects the passphrase

…i123#837)

- Store an encrypted verification token during first-time vault setup
- Always verify the passphrase by decrypting the verification token,
  even when no credentials are stored yet
- Prevents silent irreversible lock-out when wrong passphrase is used
  on an empty vault
@saurabhhhcodes
saurabhhhcodes requested a review from shouri123 as a code owner July 4, 2026 18:18
@github-actions github-actions Bot added gssoc Official GSSoC contribution issue gssoc:approved GSSoC: PR approved and scored labels Jul 4, 2026
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 57 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6ed8498b-fc46-4cb7-bc67-b1edc08dfe9f

📥 Commits

Reviewing files that changed from the base of the PR and between d216444 and f54d12c.

📒 Files selected for processing (1)
  • src/utils/credentials.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Thank You for Contributing to Late-Meet

Please ensure that:

  • the issue was assigned to you before opening this PR
  • the PR references the related issue
  • your changes follow repository contribution guidelines
  • the project builds successfully before submission

Unassigned, duplicate, or low-quality PRs may be closed.

Thank you for contributing 💙

@github-actions github-actions Bot added bug Something isn't working size/S type:code Type: Code change security-review Requires security review before merge and removed bug Something isn't working size/S labels Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

👋 Thank you @saurabhhhcodes for your contribution to Late-Meet!

⚠️ Warning: This PR does not seem to link to an open issue. Please edit the PR description to include Closes #XX to ensure your contribution counts for GSSoC points.

Please review any automated suggestions or code review comments that may appear below! We will review your PR as soon as possible!


Please consider starring the repository ⭐ to show your support!

@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been marked as stale due to inactivity.

@github-actions github-actions Bot added the stale label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved and scored gssoc Official GSSoC contribution issue needs-issue security-review Requires security review before merge stale type:code Type: Code change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant