Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.

v1.4.5: install patched Node on update, verify TLS in gateway and scripts, pin actions - #48

Merged
SashaMIT merged 3 commits into
mainfrom
sec/1.4.5-hardening
Oct 22, 2026
Merged

SashaMIT merged 3 commits into
mainfrom
sec/1.4.5-hardening

Conversation

@SashaMIT

Copy link
Copy Markdown

Do not merge until tested on zzz.

v1.4.5 finishes the Node.js October security work and removes the last places that skip certificate checks.

Node.js upgrade on update

  • New scripts/install-node.sh: if the node on PATH is unpatched (below 24.22.1 / 22.23.4 / 26.12.1), it installs the official nodejs.org 24.22.1 build, checked against SHASUMS256.txt, into root-owned /opt and links it into /usr/local/bin. It exits 2 and leaves Node unchanged on nvm, macOS, 32-bit OS, missing sudo, or a binary that doesn't run (old glibc). To roll back, remove the four links.
  • update.sh runs it before npm install and rebuild, then runs pm2 update if the Node version changed, so pc2 actually runs on the new Node. PC2_SKIP_NODE_UPGRADE=1 skips the step.
  • install-arm.sh and the supernode bootstrap use the same installer instead of NodeSource, whose 24.x channel still has the unpatched 24.22.0.
  • New CI job install-node-script upgrades a NodeSource Node 20 + pm2 install on x64 and arm64.

TLS

  • pc2-node removes a leftover NODE_TLS_REJECT_UNAUTHORIZED=0 at boot. That also covers nodes updated in-app, which never run update.sh. update.sh strips it from .env and no longer copies it forward. ecosystem.config.cjs always sets it to 1.
  • web-gateway: DHT, gossip and registry-sync requests now go through lib/peer-request.js (http/https, never decompressed, Brotli refused). Elacity supernode IPs are verified as supernode.ela.city. Gossip between InterServer and Contabo was failing certificate checks before this. Registry sync is off on both (REGISTRY_SYNC is unset), so neither registry.json is written to.
  • curl -k is gone from the bootstrap, deploy-supernode.sh, setup-wireguard-client.sh and pc2-diagnose.sh. Each now uses --resolve supernode.ela.city:443:<ip> (or the real domain); every form was checked live and returns verify=0. cluster-backfill.mjs and wave8-supernode-live-verify.mjs no longer disable verification.

CI

  • All 38 uses: are pinned to commit SHAs (same commits the major tags point to today), and main.yml now declares its permissions.

Not changed

  • engines stays at >=20.18.0: nodes that can't upgrade (nvm, 32-bit) would only get warnings.
  • The legacy Puter tests/api-tester and tools/comment-writer dev tools are left as they are; they aren't shipped to or run on nodes.

Tested

  • Unit tests on Node 20.20.2 and 24.22.1: 64 pass, including the new gateway-peer-request (6) and TLS-env tests. The 3 failures are the borrowed local better-sqlite3 build (wrong ABI); CI does a clean install.
  • Live certificate-verified requests to both supernodes from peer-request, the bootstrap helper and the WireGuard/diagnose/deploy forms.

SashaMIT and others added 3 commits October 22, 2026 17:31
…ipts, pin actions

- scripts/install-node.sh: nodejs.org Node 24.22.1 (SHA-256 checked) into /opt,
  linked into /usr/local/bin; used by update.sh, install-arm.sh, supernode bootstrap
- update.sh: Node upgrade step + pm2 daemon restart; strip NODE_TLS_REJECT_UNAUTHORIZED=0 from .env
- pc2-node: ignore leftover NODE_TLS_REJECT_UNAUTHORIZED=0 at boot
- web-gateway: peer/DHT requests without decompression, supernode certs verified
- remove curl -k / rejectUnauthorized:false from scripts and tooling
- pin GitHub Actions to SHAs; permissions on main.yml; install-node CI job

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…erServer's live copy)

Co-authored-by: Cursor <cursoragent@cursor.com>
@SashaMIT
SashaMIT merged commit 7c6ed93 into main Oct 22, 2026
11 of 12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant