Skip to content

Update vulnerable HogHabits dependencies and require Node.js 22.22.0 or newer - #18

Merged
carles-ph merged 2 commits into
PostHog:mainfrom
virusimmortal00:codex/hoghabits-security
Dec 1, 2026
Merged

carles-ph merged 2 commits into
PostHog:mainfrom
virusimmortal00:codex/hoghabits-security

Conversation

@virusimmortal00

@virusimmortal00 virusimmortal00 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

On November 30, 2026, npm audit reported four affected packages in a clean install of the base commit (one critical, two high, one low). A clean install of the PR head returned zero findings.

Package Before After
next 16.3.0 16.4.6
sharp 0.35.3 0.35.6
source-map-js 1.2.1 1.3.0
dompurify 3.4.13 3.5.0

The starter, sabotage reference, and drill 10 now pin the same Next.js release. Drill 10 still installs posthog-js 1.200.0 to demonstrate an outdated SDK.

Node.js minimum

The starter app now declares node >=22.22.0, matching the engine requirement published by the Lab 07 wizard (@posthog/wizard@3.0.0). npm normally warns on an engine mismatch. With --engine-strict, it rejects the install. The sabotage reference and drill 10 carry the same declaration. The setup guides recommend the latest patch of a supported LTS release. Node 20 reached end of life on April 30, 2026. Node.js release schedule

Other lockfile updates

Package or group Before After
Next.js environment and compiler packages (@next/env, @next/swc-*) 16.3.0 16.4.6
sharp platform binaries 0.35.3 0.35.6
sharp’s bundled libvips packages 1.3.2 1.3.5
@swc/helpers 0.5.15 0.5.23
semver 7.8.5 7.8.6
tslib 2.8.1 2.9.1

Verification

Tested on macOS (Apple Silicon).

Node npm Clean install and audit Production build Chrome smoke test
22.22.0 (lab minimum) 10.9.4 Passed, zero vulnerabilities Passed Passed locally with next dev and next start
  • npm ci --engine-strict accepted Node 22.22.0 and reported EBADENGINE on Node 20.20.2.
  • In Chrome, created a workspace, added a habit, checked in, reloaded and confirmed the streak was still one, then completed the simulated Pro upgrade. The signup and check-in API requests both returned HTTP 200.
  • On Node 22.22.0, ran the sabotage CLI through prepare, drill 10, heal, and restore. Confirmed drill 10 installed posthog-js 1.200.0 and heal returned it to 1.445.1, both with Next.js 16.4.6. The same browser flow passed in development mode with drill 10 active and with the healed reference.
  • Exercised the updated native sharp dependency on Node 22.22.0 by resizing a PNG and encoding it as WebP.

PostHog requests used a local test endpoint. Live analytics delivery and the Lab 07 wizard were outside this smoke test.

@carles-ph
carles-ph merged commit 7180654 into PostHog:main Dec 1, 2026
6 checks passed
@carles-ph

Copy link
Copy Markdown
Collaborator

thanks @virusimmortal00 for the contribution! ⭐

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