Conversation
…dencies Fix three critical timing attack vulnerabilities in CSRF token validation that could allow attackers to reconstruct valid tokens through timing analysis. Replace non-constant-time string comparisons with timingSafeEqual() to prevent timing side-channel attacks. Additionally, fix weak default secret generation and update all vulnerable dependencies to their patched versions. Security Fixes: Fix timing attack in validateDoubleSubmit token comparison Fix timing attack in validateSignedDoubleSubmit cookie integrity check Fix timing attack in validateSignedDoubleSubmit token matching Fix weak secret generation using proper base64 encoding instead of comma-separated decimals Dependency Updates: Update qs to >=6.14.1 via pnpm override (fixes CVE-2025-15284 - DoS vulnerability) Update tsdown to 0.20.1 (fixes CVE-2026-24001 in diff dependency) Update @changesets/cli to 2.29.8 (fixes js-yaml vulnerability) Update next to 15.4.10+ (fixes multiple CVEs: 1112593, 1112638, 1112649) Update @biomejs/biome to 2.3.13 Update @types/node to 25.1.0 Update vitest and related packages to 4.0.18 Update typescript to 5.9.3 Update jsdom to 27.4.0
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughHark: CSRF validation comparisons were hardened to constant-time operations, secret generation now uses a secure helper, and multiple dependencies (including qs, diff, js-yaml, next, tooling) were upgraded; package entrypoints for the core package moved to MJS formats. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.changeset/critical-security-fixes.md:
- Line 32: The CVE identifiers in the changeset entry ("1112593, 1112638,
1112649") are missing the standard CVE prefix and year; update the line
containing "**next** (CVEs: 1112593, 1112638, 1112649): Updated to 15.4.10+ -
fixes multiple security issues" to use full CVE notation (e.g., CVE-YYYY-NNNNN)
for each identifier, ensuring the correct year is applied and the format matches
"CVE-YYYY-NNNNN" so the references are traceable.
In `@package.json`:
- Line 41: The package.json dependency "@types/node": "^25.1.0" is pinned to
Node 25 typings which will mismatch the project's engine (Node >=18.0.0); update
the dependency to a version that aligns with the supported Node range (for
example change "@types/node" to "^22.0.0" or to a version that matches your
minimum engine) so type definitions reflect the actual runtimes developers will
use and avoid type/runtime divergence.
🧹 Nitpick comments (1)
.changeset/critical-security-fixes.md (1)
46-46: A whisper from the static analysis oracle.The phrase "high severity" might benefit from a hyphen when used as a compound adjective: "high-severity vulnerabilities." A small matter, yet precision in language mirrors precision in code.
📜 Suggested refinement
-- ✅ Zero high severity vulnerabilities +- ✅ Zero high-severity vulnerabilities
…equirement Update Next.js changeset entry to use proper CVE-YYYY-NNNNN format (CVE-2025-59471, CVE-2025-59472, CVE-2026-23864) Downgrade @types/node from ^25.1.0 to ^20.0.0 to match Node >=18.0.0 engine requirement Resolves peer dependency warnings and prevents type/runtime divergence
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.changeset/critical-security-fixes.md:
- Line 7: Replace the bolded prose line "**SECURITY FIXES: Critical timing
attack vulnerabilities and dependency updates**" with a proper Markdown heading
(remove the surrounding ** markers and prepend an appropriate heading marker
like "# " or "## "), e.g. "## SECURITY FIXES: Critical timing attack
vulnerabilities and dependency updates", so the title is a real heading rather
than emphasized text to satisfy MD036; target the exact string "**SECURITY
FIXES: Critical timing attack vulnerabilities and dependency updates**" in the
.changeset/critical-security-fixes.md file.
- Around line 36-38: The changelog entry for "@types/node" in
.changeset/critical-security-fixes.md conflicts with package.json: the changelog
lists 25.1.0 while package.json has ^20.0.0; reconcile by either (A) updating
the changelog line to match package.json (change "Updated `@types/node` to 25.1.0"
→ "Updated `@types/node` to ^20.0.0") or (B) bumping the dependency in
package.json to 25.1.0 and then regenerate the lockfile (npm/yarn/pnpm install)
so package.json, lockfile, and the changelog all agree; make sure the unique
token "@types/node" is the one updated and confirm consistency across
.changeset/critical-security-fixes.md, package.json, and the lockfile.
- Around line 45-47: Update the three checklist lines so they clearly state the
post-upgrade status: replace "✅ Zero critical vulnerabilities" with "✅ Zero
critical vulnerabilities remaining", change "✅ Zero high severity
vulnerabilities" to "✅ Zero high-severity vulnerabilities remaining"
(hyphenating "high-severity"), and replace "✅ Zero known CVEs (verified via pnpm
audit)" with "✅ No remaining known CVEs after upgrade (verified via pnpm
audit)"; keep the verification note and emoji formatting intact.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Muneeb Samuels <muneebs@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Muneeb Samuels <muneebs@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Muneeb Samuels <muneebs@users.noreply.github.com>
Summary
This PR fixes critical timing attack vulnerabilities in CSRF token validation and updates all vulnerable dependencies to their patched versions.
Changes Made
!==withtimingSafeEqual()in token validation (validation.ts:104, 142, 147)Key Improvements
Technical Details
Security Fixes
All CSRF token comparisons now use constant-time equality checks to prevent timing attacks:
Default secret generation now uses
generateSecureSecret()for proper base64-encoded high-entropy secrets.Breaking Changes
None - all changes are backward compatible.
Testing Instructions
pnpm installto update dependenciespnpm test- all 66 tests should passpnpm audit- should report zero vulnerabilitiesImpact Assessment
Checklist
Related Issues
Addresses critical security vulnerabilities discovered in security audit.
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.