fix(session): raise default seal PBKDF2 iterations to 8192#1457
Conversation
Adds a transitional fallback that unseals existing sessions sealed with the legacy default (iterations: 1) and transparently reseals them, to be removed before v2 stable. Co-Authored-By: Claude Fable 5 <[email protected]>
📝 WalkthroughWalkthroughChangesSession seal upgrade
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…nseal Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/session.ts (1)
271-271: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider avoiding
as anyfor thekLegacySealmarker.A typed intersection keeps the symbol property visible to the compiler while preserving the same runtime behavior.
♻️ Optional refactor
- (unsealed as any)[kLegacySeal] = true; + (unsealed as Partial<Session> & Record<typeof kLegacySeal, boolean>)[kLegacySeal] = true;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/utils/session.ts` at line 271, Update the assignment to kLegacySeal in the unsealed session flow to avoid the any cast. Use a typed intersection that explicitly includes the symbol property, preserving the existing marker assignment and runtime behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/utils/session.ts`:
- Line 271: Update the assignment to kLegacySeal in the unsealed session flow to
avoid the any cast. Use a typed intersection that explicitly includes the symbol
property, preserving the existing marker assignment and runtime behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f8556454-9b2e-484f-bc1e-1a48978ac5cd
📒 Files selected for processing (2)
src/utils/session.tstest/session.test.ts
Hardens session sealing by raising the default PBKDF2 iteration count from
1to8192(KDF stretching as defense-in-depth; secret entropy remains the primary boundary).passwordmust be generated from a cryptographically random source.🤖 Generated with Claude Code
Summary by CodeRabbit
Security
Bug Fixes
legacySealFallback) to reject older tokens when disabled.Tests