Skip to content

fix(deps): upgrade Next.js to 16.4.3 for three security advisories - #870

Merged
ng merged 2 commits into
sleepypod:devfrom
jasonlarue:fix/next-security-upgrade
Oct 25, 2026
Merged

ng merged 2 commits into
sleepypod:devfrom
jasonlarue:fix/next-security-upgrade

Conversation

@jasonlarue

@jasonlarue jasonlarue commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Upgrades Next.js to 16.4.3. The installed 16.4.0 is affected by three advisories, and next build now refuses to build it, so every production build and deploy of dev fails with SecurityFatalError: Your version of Next.js is affected by a known security vulnerability.

Advisory Severity Issue
GHSA-2464-fhr4-w9xw critical Unauthenticated RCE in the Image Optimization API when SVG files are used
GHSA-673q-mjm6-r5xr critical Unauthenticated RCE in use cache functions returning typed arrays
GHSA-p3m5-59mp-jv5r high Denial of service in the App Router using Server Actions

All three affect >=16.0.0 <=16.4.0 and are fixed from 16.4.1. The pod's API is unauthenticated on the LAN, so the RCE paths are worth closing regardless of the build gate.

Changes

  • next and eslint-config-next: ^16.1.6 (locked at 16.4.0) → ^16.4.3, so @next/env, @next/swc-* and @next/eslint-plugin-next move with them.
  • Transitive updates: pnpm also refreshed a few dependencies of Next.js (@babel/parser/types, browserslist, caniuse-lite, baseline-browser-mapping).
  • Hashes: the biometrics manifest pins pnpm-lock.yaml (dependencyHashes), so that hash is refreshed and the demo worker was rebuilt (worker-build.json).

Checks

  • pnpm build completes with no security stop; 44/44 static pages generated.
  • tsc --noEmit and eslint . --max-warnings=0 are clean.
  • Full vitest run, plus pytest common (424 passed). The only failures:
    • load timeouts that pass on rerun (waveform-publication, runtime-integration, worker-child);
    • src/mcp/tests/server.test.ts > get_sleep_stage_rules counts an in-bed night… (epochs 72 vs 144). This fails on dev without this change too, so it's unrelated and probably date-dependent.
  • The full pre-push gate passes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the application framework and its associated development tooling.
    • Refreshed internal build and package verification records.
    • Updated automated checks for sleep-stage data across the rolling 14-day window.
    • No user-facing changes are identified in this update. These changes update project tooling and verification records; they do not introduce new app features or alter the experience described in these release notes.

Next.js 16.0.0-16.4.0 is affected by:
- GHSA-2464-fhr4-w9xw (critical): unauthenticated RCE in the Image
  Optimization API when SVG files are used
- GHSA-673q-mjm6-r5xr (critical): unauthenticated RCE in `use cache`
  functions returning typed arrays
- GHSA-p3m5-59mp-jv5r (high): denial of service in the App Router through
  Server Actions

`next build` now refuses to build an affected version, which blocked every
production build and deploy. next and eslint-config-next move to 16.4.3
(patched from 16.4.1). The biometrics manifest pins pnpm-lock.yaml, so its
dependency hash and the demo worker build hash are refreshed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@jasonlarue is attempting to deploy a commit to the therealng's projects Team on Vercel.

A member of the Team first needs to authorize it.

@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c265f0e-13aa-4719-a415-a222ad249816
Commits

Reviewing files that changed from the base of the PR and between e7adb56 and dfc5662.

Files selected for processing: 1
  • src/mcp/tests/server.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The Next.js dependency ranges and recorded hashes changed. MCP sleep-stage tests now control the date and cover the rolling 14-day reference window.

Changes: Next.js dependency update

Layer / File(s) Summary
Update dependency ranges and recorded hashes
package.json, modules/common/biometrics/manifest.v1.json, src/demo/biometrics/worker-build.json
The next and eslint-config-next version ranges changed from ^16.1.6 to ^16.4.3. The recorded pnpm-lock.yaml hash and worker build hash changed.

Sleep-stage window tests

Layer / File(s) Summary
Test the rolling reference window
src/mcp/tests/server.test.ts
The sleep-stage test setup freezes the date and restores real timers after each test. A new test checks the reference-stage query window from October 12 to October 26, 2026, and expects 36 coverage epochs when one of two fixture segments is expired.

Priority: High

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: ng

Merge Risk: Minimal · up to dfc56

No actionable current-head issue is established by the reviewed dependency and test changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: upgrading Next.js to 16.4.3 to address three security advisories. The changeset matches this. The package.json bumps next and eslint-config-next from ^16.1.6 to ^16.4.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: upgrading Next.js to 16.4.3 to address three security advisories. The changeset matches this. The package.json bumps next and eslint-config-next from ^16.1.6 to ^16.4.3, and the manifest hash and worker build change follow from the lockfile update. The test file change (clock freeze for sleep-stage fixtures) is a secondary change that the title does not mention, which is acceptable because the title need not cover every detail. The title is 66 characters and uses the conventional commit prefix, so it is concise and specific.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ng
ng enabled auto-merge October 25, 2026 18:08
@ng
ng added this pull request to the merge queue Oct 25, 2026
Merged via the queue into sleepypod:dev with commit 47034d4 Oct 25, 2026
14 of 15 checks passed
ng added a commit that referenced this pull request Oct 30, 2026
…RV and breathing references, and schedule library (#878)

Promotes `dev` to `main` with personal sleep-stage models, a heart-rate estimator that stops guessing on weak signal, beat-to-beat heartbeat detection, Watch HRV and breathing references, a schedule library, and the Next.js 16.4.3 security upgrade.

## Changes
- Personal sleep-stage models: train off the pod from the phone's feature contracts, run them on the pod, keep several per side, upload a `candidate.json` from Settings, and stage a side's nights with its model when switched on. Includes MCP tools (#855, #857–#860, #864, #866).
- Biometrics calibration on one page, with frozen dataset export and profile fitting on a laptop (#836, #837, #841).
- Heart rate: windows scoring below `heart_rate.minimumPeakScore` (default 0.4) now report no heart rate instead of a guess. In local replay this cut Watch HR error from 5.2 to 1.75 bpm on tuning nights and from 4.3 to 3.1 bpm on held-back nights, at about 75% coverage (#840).
- Beat-to-beat heartbeat detection in the piezo-processor, stored per minute in a new `heartbeats` table. Vitals are unchanged. Heartbeat retries now use bounded, ordered backoff (#848, #865).
- Apple Watch references: import breathing rate and HRV (SDNN), add a pod-vs-Watch deviation report with night-by-night charts on the calibration page, render Watch-only nights, and archive pod biometrics off the pod for long-term comparison (#842, #844, #845, #847, #867).
- Read-only analysis snapshot export (DB backup + RAW window) and MCP tool. Health export uploads are no longer truncated at 10 MB (#843, #839).
- Schedule library with switchable curves, alarm snooze length with Snooze taper, and independent tap actions for normal and while-ringing (#835, #861, #849).
- Storage: eMMC endurance card, RAM-only journal, and flash write insights with recording controls (#838, #854).
- Surface the frzWater tank level and sensHealth cover disconnects, and register `sensHealth`, `frzWater` and `lps` as known record types (#872, #877).
- Fix the internet access toggle after a reboot and the false "firewall rules missing" notice. Also fix false high TEC and slow fan warnings on an idle pod, and grant the service user journal read access (#856, #809, #801).
- Security: upgrade Next.js to 16.4.3 for three advisories and require patched Node.js in development and pod installs (#870, #868).
- Add the Europe/Bucharest timezone, update dependencies, fix the Renovate config, and kill surviving mutants (#874, #851, #853, #875, #852).

## Migrations
- Configuration DB: schedule library, stale gesture alarm field cleanup, side stage models and the active model, and alarm snooze (0028–0034).
- Biometrics DB: reference samples, heartbeats, and 0031 (0031–0033).

## Deploy note
#840 bumps the biometrics manifest to 1.1.0. Profile revisions pinned to the old manifest will report `PROFILE_INCOMPATIBLE` and must be re-proposed against the new one.

## Test plan
- [x] GitHub checks on the `dev` head (`1fbb953f`): CI, Build & Package, Dev Release, Publish OpenAPI Spec, Ref Collision Check.
- [ ] After merge, wait for "Analyze & Release" on the `main` merge commit, then `sudo sp-update main` once on a pod and confirm the service starts and migrations apply.
- [ ] Re-propose any active biometric profile against manifest 1.1.0 and confirm it applies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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