r/node • • 4h ago

I recreated the Node2Shell (CVE-2026-111497) RCE attack as an interactive exercise

6 Upvotes

On 21 October 2026, fixes shipped for CVE-2026-111497, nicknamed Node2Shell (also HTTP2Shell). It's an out-of-bounds write in Google's Brotli decoder, and Node bundles its own copy of Brotli inside the runtime. Any Node service that decompresses Brotli traffic, whether incoming request bodies or responses it fetches, can be pushed into running attacker commands with no login.

I made a hands-on lab exercise on it. You'll send a crafted Brotli-compressed request to a Node API as the attacker and read a deploy token out of process.env, then switch sides and patch it. You'll also see why blocking Brotli-compressed requests at the edge isn't enough, and why a patched system libbrotli package doesn't help: only upgrading Node itself (24.22.1 in the exercise) and redeploying does.

If you notice any issues or inconsistencies, please let me know!

https://ransomleak.com/exercises/http2shell-rce/


r/node • • 11h ago

Junior Devs Who Got Hired 2026 - What Made You Get In?

10 Upvotes

Hey,

So I self studied full stack development since the beginning of the year, I'm applying for few months already.

I work as a guard in a security company. I created a shift management app with Next.js (JS/Node.js/TS/React), where the guards send their availability with notes for the next week, and the manager sees everything in one place, per building.

I'm having a hard time finding a job. I got one change, I passed home exam with language I didnt work with, but after that I did not pass the HR interview (she told me where I fell, it is fixable for the next interview).

I don't even know what to do, I feel like giving up. I tried to build a task manager app for my home recurring tasks, with AI native, I just told him to give me commit names and I picked what he needs to do, it feels like these days I'm not even needed.

Please help me guys!


r/node • • 23h ago

Running dedicated game servers in Node for a browser racing game, where players open their own

Enable HLS to view with audio, or disable this notification

11 Upvotes

Voltane is a browser RC-car racing game. The race rooms run in Node, and since this week players can open their own dedicated servers: a name, a programme of tracks (including circuits other players built), their rules, open or private.

A few things that mattered:

  • Rooms go lobby → loading → countdown, and the countdown waits until every connected player has finished loading (with a time limit so one slow phone can't hold everyone).
  • Updates are announced 2 minutes before a new server version, so nobody gets cut mid-race.
  • The same simulation package runs on the server and in the browser.

Play or open a server: playvoltane.com


r/node • • 1d ago

Where do you host a small Express API + always-on worker + Postgres cheaply?

13 Upvotes

Small app: Express API, Postgres, and a worker that polls an outbox table every 5s for background jobs. Low traffic, but the worker can't sleep, so free tiers like Render free and Neon free don't work.

Options I'm weighing:

- AWS free plan for 6 months (then ~$25/month)

- Hetzner CX23 (~€6/month) with everything on one box

- Railway Hobby (~$5-8/month)

What would you pick, and what am I missing? Please suggest.


r/node • • 11h ago

I built flaregram — a tiny (~19 kB) Telegram bot framework that runs entirely on Cloudflare Workers' free tier

Post image
0 Upvotes

r/node • • 17h ago

Has anyone recently placed a US Domino’s order with the `dominos` Node package? Validation works; placement requires verification

0 Upvotes

I’m building a small keyboard-driven ordering app around `RIAEvangelist/node-dominos-pizza-api` (`dominos` 3.3.1), following its Customer → store → menu → Item → Order → validate → price → payment → place sequence.

On October 26, 2026, US store discovery, menu loading, validation and pricing worked. A carryout order’s card payment matched the returned total. But `POST /power/place-order` returned HTTP 200 with top-level and nested status -1:

```text

recaptchaVerificationRequired

googleRecaptchaScore: TokenMissing

blockedByRecaptcha: true

googleRecaptchaActions: { action: null, expectedAction: null }


r/node • • 1d ago

Typed WebSockets for Node, with AsyncAPI docs and a client generated from them

4 Upvotes

Hi all, I want to share a WebSocket framework I built to make WebSocket apps typed and safe, keep the client and server schemas from drifting apart, and generate the docs for you.

Every WebSocket project I've worked on ended up looking the same. The server parses JSON and walks an if (data.action === 'chat') ... else if ... chain, checking payloads by hand. The client guesses the message shapes from a docs page that someone forgot to update. Rooms live in an in-memory Map, which works until you run a second instance. And when an HTTP route or a background job needs to push something to users, there's no clean way to reach the socket.

I first built it in Python (chanx, for Django and FastAPI), since that's my main backend language. Then my frontend needed a proper client, so I made chanx-js, which was client only at first. The Python side has been stable for a while now and some teams run it in production, so I ported the server to Node as well. You can now use it on Node, Express, Fastify, NestJS and others.

What it gives you:

  • One handler per message type, validated with Zod, Valibot, ArkType or any Standard Schema
  • AsyncAPI 3 docs generated from your code, served by the server
  • A typed client generated from those docs, so sending a wrong payload fails to compile
  • Groups and broadcasts across instances through Redis
  • chanx.broadcastEvent(...) to push to users from a route handler or a job
  • Works with ws, Express, Koa, Fastify, Hono, NestJS, Bun and Deno, and the client has React, Vue, Svelte and Solid bindings

A chat room looks like this:

and on the client, after npx @chanx-js/codegen http://localhost:8000/asyncapi.json:

Repo: https://github.com/chanx-dev/chanx-js

Docs: https://js.chanx.dev/

The Node server is still new, so if you run into any problem or have ideas to improve it, please open an issue or a discussion on the repo. Stars and PRs are welcome too.


r/node • • 2d ago

PHP had to scramble last week - now it is Node's turn. Node2Shell, or Broccoli2Shell if you’re feeling leafy - RCE works in lab conditions.

Thumbnail ellio.tech
132 Upvotes

It’s got three names already - Node2Shell, HTTP2Shell, Broccoli2Shell - because of course it does. Whatever you call it, same compression bug, different runtime: PHP patched its pre-auth RCE wave last week, this is ours.

  • This one is quite less theoretical than PHP2Shell - PoC is working in the lab against Node 24.22.0 on x86-64, shell returned as the service account.
  • Meanwhile a scanner is already out there fingerprinting which hosts decompress Brotli - building the hit list before the exploit goes wide.
  • Patch to 22.23.4 / 24.22.1 / 26.12.1.

r/node • • 1d ago

Built my own TOTP authentication library in Node.js + TypeScript

Thumbnail
0 Upvotes

r/node • • 1d ago

libtmux-ts 0.1 - tmux library for Node.js, TypeScript, bun

Thumbnail github.com
2 Upvotes

r/node • • 2d ago

Best practices for OpenAPI spec generation + validation with express.js?

5 Upvotes

I've recently started a TypeScript Express.js project and while I'm familiarizing myself, I'm struggling to know what the best way to support OpenAPI spec generation and how to streamline endpoint parameter validation.

For example, with Django & Django Rest Framework, you define your API endpoints, what they receive and return, and parameters are automatically validated and you can even generate OpenAPI specs from them with another library.

For Express, I'm seeing solutions like JSDoc, which require you to write specs in comments above function definitions, or express-openapi-validator, which require you to maintain the endpoints and spec separately, but performs the validation. I see tools for generating route code, but not vice versa.

Am I approaching this from the wrong angle? I really like having my source of truth lie in the actual code for an endpoint, with specs/validation coming from that definition, not the other way around. What packages/solutions do you recommend for this?


r/node • • 1d ago

I got tired of `process.env.X` being `string | undefined`, so I made a CLI that generates a zod-validated `env.ts` from your `.env`

0 Upvotes

Every project I start ends up with the same file: a zod schema for env vars, copied from the last project and slowly falling out of sync with .env. So I made type-envgen, which generates that file for you.

You write your .env as usual. Where you want more than the default, add a comment tag above the key:

```bash NODE_ENV=development

@type url

DATABASE_URL=postgres://localhost:5432/app

@min 1

@max 65535

PORT=3000

DEBUG=false

@type enum(debug, info, warn, error)

@default info

LOG_LEVEL=info

@min 32

JWT_SECRET=change-me-change-me-change-me-123

@optional

SENTRY_DSN= ```

Run npx type-envgen and you get this:

```ts import { z } from "zod"; import { validateEnv } from "type-envgen";

export const envSchema = z.object({ DATABASE_URL: z.url(), DEBUG: z.stringbool(), JWT_SECRET: z.string().min(32), LOG_LEVEL: z.enum(["debug","info","warn","error"]).default("info"), NODE_ENV: z.enum(["development","production","test"]), PORT: z.coerce.number().int().min(1).max(65535), SENTRY_DSN: z.string().optional(), });

export const env = validateEnv(envSchema, process.env); export type Env = z.infer<typeof envSchema>; ```

env.PORT is now a number and env.DEBUG is a boolean. If something is wrong, the app fails at startup with one readable list instead of crashing three files deep later on:

[type-envgen] Invalid environment variables: DATABASE_URL: missing JWT_SECRET: must be at least 32 characters NODE_ENV: must be one of: development, production, test PORT: must be at most 65535

The error messages never print the actual values, so secrets don't end up in your logs.

Other things it does:

  • No tags needed: untagged keys are typed from their value (numbers, booleans, URLs, emails, UUIDs, dates, IPs, even JSON objects).
  • Lots of types: about 40 @types map directly to zod 4 formats (jwt, hash, iban, e164, cidr…), plus checks like @pattern, @startswith and @nonempty, and transforms like @trim and @tolowercase.
  • Framework targets: --target vite | nextjs | astro | sveltekit | nuxt reads from the right place for each framework. It also warns if a key is missing the public prefix, so you don't ship a secret to the browser.
  • Safe to regenerate: your own code in env.ts is kept, and only the generated parts are replaced.
  • CI and dev: --check exits 1 in CI if the file is stale, and --watch regenerates while you develop.
  • Setup: npx type-envgen init asks a few questions and adds the npm scripts for you.

GitHub: https://github.com/OlaleyeFisayo/type-envgen

npm: type-envgen

It's MIT-licensed. I'd really like feedback, especially on what tags or targets you'd want next.


r/node • • 2d ago

I built a self-hosted OpenID Connect server: one container + Postgres, many tenants (release candidate)

Post image
0 Upvotes

I've been building Odudu, an OIDC / OAuth 2.0 server you can run yourself, and the first release candidates are out.

What it is:

one container plus PostgreSQL. Many tenants on one server, kept apart by the database itself. Passkeys, TOTP and recovery codes. Refresh tokens that rotate. Client credentials and token exchange for machines and agents. Per-tenant theming. An admin API and a console. An audit trail. An MCP server so an AI agent can use the admin API as tools, held to the same permissions.

What it is not (yet):

it has had no independent security review, and there is no SAML, LDAP or social login. The roadmap page lists what is planned and what was decided against.

Try it in a minute (Docker + curl):

curl -fsSLO https://github.com/wizzywit/odudu/releases/download/v0.1.0-rc.3/compose.yaml && docker compose up -d && docker compose logs setup

Repo: https://github.com/wizzywit/odudu

Docs: https://wizzywit.github.io/odudu/docs/

AGPL-3.0 for the server, Apache-2.0 for the guides and examples. I'd value blunt feedback: what would stop you trying it, and what is missing for your setup?


r/node • • 3d ago

Typescript Mock Interviews

Thumbnail
0 Upvotes

r/node • • 4d ago

reconnect logic for a node websocket client that filters posts by trading pair

3 Upvotes

Websocket clients that run for days have one problem nobody mentions in the readme. The socket drops every few hours, and when it comes back there’s no way to tell if posts were replayed or skipped. Most small bot repos just reconnect and hope.

One filter project on binance square shows the issue well. Binance has no public api for it, so the data comes from the client in the 1322io repo, where every message has a coin_pairs field. The filter checks if the list contains a pair like SOLUSDT and drops the rest, so no text parsing is needed. Reconnects are the weak spot, since logging post ids to a file is the only protection against duplicates and it was never tested properly.

For anyone who has built on a feed with no replay option, do you dedupe by post id or keep a last seen timestamp? And how do you test a reconnect without waiting for the socket to drop on its own?


r/node • • 3d ago

TIL jest.useFakeTimers() doesn't freeze your tests at a fixed date. it freezes them at right nowjest.useFakeTimers() freezes time at today, so your "deterministic" test still depends on the date

0 Upvotes

til the hard way: jest.useFakeTimers() freezes the clock, but at the current time. unless you call setSystemTime, your test still runs on today's date, it just looks deterministic. vitest does the same.

why i care: i made a cli that skips tests that already passed on the exact same code. tests that read the real clock break that idea, because they can pass today and fail next month on the same commit (a token that expires in 30 days, a date that's now in the past). so the tool watches which tests read the clock, and those passes only count until midnight.

i'd assumed fake timers were safe and let them through. they weren't. now it counts them too, unless the test sets a fixed time.

fixing it took me through some fun node internals, including node's own mock.timers breaking when i touched Date the wrong way. happy to go into that in the comments if anyone's curious.

do you freeze time in every test, or let some of them read the real clock?


r/node • • 4d ago

npmpulse: a new website to query npm package downloads data

Thumbnail
0 Upvotes

r/node • • 5d ago

Recently got a PR merged into TanStack Query

Thumbnail
4 Upvotes

r/node • • 5d ago

Google released patch for node22 0-day at 18:45 UTC

37 Upvotes

r/node • • 6d ago

Evolution Of HTTP: An Interactive Guide

Thumbnail prateeksurana.me
18 Upvotes

r/node • • 5d ago

I added more RAM to my server because I forgot where I put setInterval()

0 Upvotes

I’ve been building a small invoice reminder app after work. It had six users, including me, and was running as a Node app on serverspace cloud server.

One evening I noticed the memory usage slowly climbing. Restarting the app fixed it, but only for about half an hour.

I did what any tired developer would do and decided the infrastructure was the problem.

I added more ram.

The next morning, the memory was climbing again.

After going through the logs I finally found a setInterval() inside a function that ran whenever someone logged in. Every login started another background job to check for overdue invoices. None of the old ones ever stopped.

There wasn’t a sudden increase in users. There were just dozens of copies of my reminder job quietly running at the same time.

I moved the timer out of the login flow, restarted the app and returned the server to its original configuration. The memory graph has been almost completely flat since then.

The app didn’t need more ram. It needed me to stop creating immortal timers


r/node • • 6d ago

Next.js isr behaviour related confusion

Thumbnail
3 Upvotes

r/node • • 7d ago

PortFox - A lightweight CLI to find, inspect, and manage ports in use

Post image
86 Upvotes

Hey everyone,

PortFox 🦊 is a lightweight, open-source CLI that makes managing occupied ports simple.

No more manually searching for PIDs or figuring out which process is blocking your development server.

Features:

  • Find which process is using a specific port
  • List active TCP listening ports
  • Safely terminate processes with confirmation
  • Interactive terminal interface
  • Find available ports
  • JSON output for scripts and automation

Zero npm dependencies. Built with Node.js and supports macOS, Linux, and Windows.

Try it instantly:

npx portfox 3000

Or install it globally:

npm install -g portfox

 GitHub: https://github.com/merdanturan/portFox

 npm: https://www.npmjs.com/package/portfox

MIT licensed and open to contributions.

Feedback, suggestions, and contributions are welcome!


r/node • • 8d ago

Mimic: an MIT-licensed, self-hosted alternative to WebContainers for running Node.js in the browser

Thumbnail github.com
18 Upvotes

Mimic runs Node.js projects in a browser tab, similar to WebContainers but MIT-licensed and self-hosted. Programs run in Web Workers over an in-memory file system, real npm, pnpm and Yarn install from the registry, and a server's port becomes a URL you can load in an iframe.

It runs WASI Preview 1 executables as regular processes and implements node:wasi.

The playground has Vite, Angular, SvelteKit, Astro, Rspack and NestJS examples, and can open a public GitHub repo.

Repo: https://github.com/mimic-js/mimic


r/node • • 8d ago

Extensions privacy doubt

0 Upvotes

Any of us love the extensions, sure. A lot of us are real dev, somebody deeply, and obviously we love to share scripts and ideas, it's like a form of art for people like me.

Probably it is a silly idea but it is the same problem of supplies chain for dev software web and videogames for me, and I resolve with drastic solutions.

So...

If I could accept a "trust me bro" level for a simple idea, in something like agents, mail clients, calendars, note online (so, private data), debits cards... What are your parameters or checklist to understand "*ok, I have no problem with privacy about this extension*"?

Who really checks them? No one.

I think so... Do you have a personal checklist to make sure you've got them all ok?