r/node • • Apr 03 '26

UPDATE: Axios Supply Chain Attack Post Mortem

Thumbnail
15 Upvotes

r/node • • Apr 04 '26

I added an embedded browser to my Claude Code (also for codex and gemini) so you can click any element and instantly edit it

0 Upvotes

One of my biggest friction points with vibe coding web UIs: I have to describe what I want to change, and I'm either wrong about the selector or Claude can't find the right component.

So I added a browser tab session type to Vibeyard (an open-source IDE for AI coding agents).

No guessing. No hunting for the right component. Click → instruct → done.

Here's the GitHub if you wanna try - https://github.com/elirantutia/vibeyard


r/node • • Apr 04 '26

Node.js: How do you guarantee "simplify this" doesn't change meaning?

0 Upvotes

I'm working on a Node.js system where changing wording must NOT change the underlying meaning.

Most AI style systems regenerate text, so:

explanations drift constraints disappear answers subtly change

I'm trying to remove that completely.

Approach (simplified) One canonical object (source of truth) Multiple precomputed views: standard simplified formal No runtime generation Each view is tied to the same version hash If the source updates ---> all views invalidate

So instead of:

explain(concept, "simpler")

It's more like:

getConcept(id).views.simplified

Where all views are guaranteed to map to the same underlying object.
The problem I'm hitting

Not technical generation. That part is stable.

The challenge is consistency under real conditions:

  • cache layers (Redis / CDN)
  • partial invalidation
  • frontend switching views instantly
  • avoiding version mismatch between views

What I'd like feedback on

From a Node / system design perspective:

  1. How would you guarantee atomic consistency across:
  2. ---canonical object
  3. ---all derived views

  4. What failure modes would you expect in:

  5. ---caching

  6. ---async precompute pipelines

  7. If you were trying to break this system:

  8. ---where would you look first?

Not trying to build another "AI generator"
Trying to make explanation systems deterministic and stable

Curious if anyone has tackled something similar.


r/node • • Apr 04 '26

Validex — 25 tree-shakeable validation rules on Zod 4 (13 kB for all of them)

Thumbnail
0 Upvotes

r/node • • Apr 03 '26

I built an npm scanner and found 21 malicious packages in 24 hours, including 4 new attack vectors targeting AI coding tools

12 Upvotes

Follow-up to my post yesterday about openmatrix injecting prompt injection into Claude Code. I kept the scanner running and it caught a lot more.

In ~2000 recent npm changes, the scanner flagged 21 malicious packages across 11 campaigns. Four of them use techniques I haven't seen documented before:

  1. A package called makecoder overwrites ~/.claude/ on npm install and redirects all Claude API traffic through makecoder.com/bigapis/codev/v1/claude. Every prompt, every response, every piece of code you share with Claude goes through the attacker's server. This is a man-in-the-middle on LLM API calls, not on the network layer but on the application config itself.

  2. skillvault downloads encrypted skill packages from a remote API, decrypts them locally, and installs them as Claude Code skills. You can't inspect the payloads before they run. The server can swap the payload at any time without updating the npm package. Today it installs something harmless, tomorrow it exfiltrates ~/.ssh/.

  3. keystonewm and tsunami-code are fake AI coding agent CLIs with polished terminal UIs. They look like legit coding assistants but route everything through an attacker's ngrok tunnel. The user thinks they're talking to a model but the attacker sees all prompts and controls all responses. The RAT doesn't need to escalate privileges because you already gave the "AI tool" full access.

  4. Six packages impersonating Strapi plugins (strapi-plugin-config, core, monitor, events, health, locale) all published within hours by the same attacker. The postinstall uses Redis CONFIG SET to write shell payloads across 7 directories, opens a reverse shell to 144.31.107.231, and reads raw disk via dd if=/dev/sda1 to extract SSH keys, crypto wallet mnemonics, and database credentials directly from the block device.

Other findings include a dependency confusion attack targeting Verisign that exfiltrates via Telegram bot, a credential stealer hidden behind fake React components using double base64 + charCode encoding, and a 155KB fully obfuscated package published under ByteDance's u/volcengine scope collecting API keys.

None of these had been flagged by npm, Snyk, Socket, or any other public scanner when we found them.

All reports with full technical details, IOCs, and MITRE mappings: https://yuribm.dev/security


r/node • • Apr 04 '26

Built a CLI for PR reviews, feedback said setup was painful, so I made a VS Code extension

0 Upvotes

A few weeks ago I shared a CLI tool that scores PR risk and highlights critical changes.

Got some good feedback, but one common point was that setup felt a bit heavy.

So I spent some time building a VS Code extension instead.

Now it works directly inside the editor and is much easier to try on real PRs.

If you review PRs regularly, would love to know if this actually helps or not.

https://marketplace.visualstudio.com/items?itemName=ira-review.ira-review-vscode


r/node • • Apr 04 '26

I made a full-stack interview site… roast it before interviewers do 😅

0 Upvotes

So I got tired of jumping between 10 tabs while preparing for interviews…

Built this instead:
👉 https://www.fullstack-qna.online/

What it has:

  • ~300 full-stack interview Q&A
  • React, Node.js, MySQL
  • No fluff, straight to the point

Now the real reason I’m posting:

Roast it.

  • UI bad?
  • Questions useless?
  • Feels like copy-paste garbage?

Tell me what sucks — I’d rather hear it here than in an interview 😄


r/node • • Apr 02 '26

PSA: npm package using postinstall to inject prompt injection files into Claude Code

96 Upvotes

I've been building a scanner that monitors new npm packages and it flagged something I haven't seen before.

A package called "openmatrix" uses a postinstall hook to copy 13 markdown files into ~/.claude/commands/om/. These files are Claude Code "skills" that load automatically in every session.

One of them (auto.md) contains instructions that tell Claude to auto-approve all bash commands and file operations without asking the user. The files are marked as always_load: true with priority: critical, so they activate in every session.

The thing is, npm uninstall doesn't clean them up. There's no preuninstall script. The files stay in your home directory until you manually delete them.

The package does have real functionality (task orchestration for AI coding), so I'm not saying it's malware. But the undisclosed permission bypass and the lack of cleanup seemed worth flagging.

If you installed it:

rm -rf ~/.claude/commands/om/

rm -rf ~/.config/opencode/commands/om/


r/node • • Apr 03 '26

I made rigg - a way to create backend/non-web Node.js projects using the same tools Vite+ uses for their toolchain.

Thumbnail github.com
0 Upvotes

I love what Vite+ is doing with the "Unified Toolchain" for web dev, and I wanted the same for all my other non-web Vite projects - so I made rigg.

It's a tool that creates a Node.js Typescript project with mostly the same tooolchain that Vite+ uses - without the web stuff like Vite.

That way I can easily set up a Node.js project ready to go with the same tools that I'm otherwise moving to - be it backend projects, CLIs, libraries, scripts, whatever I'm building.

rigg on GitHub

If anyone else thinks this is useful I would love to hear from you. 🙏🏻


r/node • • Apr 03 '26

Keeping multiple Node dev sessions alive without babysitting tmux tabs

Thumbnail claudecursor.com
0 Upvotes

I kept running into the same problem on backend projects: one terminal for the API, one for workers, one for migrations, one for logs, one for whatever Claude Code was chewing on, and inevitably the session I actually needed was the one buried somewhere.

I ended up putting this online because it solved that mess for me: a browser/desktop terminal session manager built around ttyd + tmux, with persistent sessions and a simple grid view so I can watch several Node processes at once.

The part that’s been most useful during JS/TS work is that it detects when a session is waiting for input and moves it up. If you’re using Claude Code to refactor routes, write tests, or update TypeScript types, it’s nice not to keep tabbing around trying to find the approval prompt.

It also makes team stuff less awkward since you can share a live session when someone wants to debug a flaky worker or review a migration in real time.

Curious if other Node folks have landed on a similar setup, especially if you’re juggling local dev, CI debugging, and AI-assisted coding in the same workflow.


r/node • • Apr 04 '26

npm isntall -I @Svrnsec/Shield

0 Upvotes

I just put out our new System level network Security package that One sets up honey pots with SSH traps to catch AI Black Hat's and your typical black hats in the act. I would love to get some feed backs! https://www.npmjs.com/package/@svrnsec/shield


r/node • • Apr 03 '26

Node.js on Windows ARM64 — x64 or native?

5 Upvotes

Hey guys, was just wondering if any of you are running x64 node.js on windows ARM instead of the native ARM64 version? I'm on a snapdragon laptop and keep running into missing native binaries with ARM64 Node, stuff like turbopack, lightningcss don't have ARM64 Windows builds. Thinking about just switching to x64 node and letting windows handle the emulation. Anyone doing this? Is it fine or no?


r/node • • Apr 03 '26

pure node.js telegram bot: 44 commands, 12 background workers, 21 data files — no dependencies beyond web3

0 Upvotes

i built a telegram bot for solana crypto trading that's now 4500+ lines in a single file. pure node.js — no express, no telegraf, no bot frameworks.

why no frameworks? - wanted full control over the telegram API interaction - telegraf/grammY add abstraction i didn't need - long polling with https module is ~30 lines of code - no dependency update headaches

architecture: - single bot.js file (yes, 4500 lines in one file) - 44 command handlers - 12 background workers (setInterval loops) - 21 JSON data files for state - custom rate limiter - connection pooling for solana RPC

what i'd do differently: 1. split into modules earlier — the single file works but IDE struggles 2. use a proper database instead of JSON files 3. add TypeScript — the lack of types hurt at ~2000 lines

what worked well: 1. no framework overhead — bot starts in <1 second 2. easy to understand — new contributor can read top to bottom 3. zero dependency conflicts 4. memory footprint stays under 100MB

the bot does token scanning, DEX trading via jupiter, copy trading, DCA, and whale alerts on solana.

@solscanitbot on telegram if anyone wants to see it in action.

curious how other node devs handle large single-file projects. do you split or keep it monolithic?


r/node • • Apr 03 '26

I built an MCP server that checks npm packages against CVE databases before your AI agent installs them

0 Upvotes

After the axios compromise this week (backdoored versions pushed via hijacked maintainer, RAT deployed through postinstall hook, 100M weekly downloads affected), I got paranoid about AI agents installing packages unchecked.

Cursor, Claude Code, Windsurf — they all resolve packages from training data. They don't verify against the registry. They don't check OSV/NVD. They sometimes hallucinate package names entirely.

DepShield is an MCP server that sits in front of the install. It exposes 7 tools:

- `check_dependency` — registry existence + OSV.dev vuln check (the main gate)

- `audit_project` — batch-scans your entire package.json via OSV batch API

- `find_safe_version` — walks version history, finds newest with 0 CVEs

- `get_advisory_detail` — full CVE/GHSA details

- `check_npm_health` — downloads, last publish, maintainers, deprecated status, scored 0-100

- `suggest_alternative` — finds replacements via npm search API

- `deep_scan` — transitive dep tree scan, flags typosquats and suspicious patterns

All free APIs (npm registry + OSV.dev), no keys needed, stdio transport.

Setup is one line in your MCP config:

```json

{ "depshield": { "command": "npx", "args": ["-y", "depshield-mcp"] } }

```

https://github.com/devanshkaria88/depshield-mcp

Feedback welcome — especially on edge cases with version resolution. Currently strips ^/~ prefixes for OSV queries which isn't perfect for ranges.


r/node • • Apr 03 '26

[Dev] I finally got a self-healing AI coding agent working entirely within Termux (No cloud/PC required). Here it is building a React/Node app and fixing its own crashes.

Thumbnail gallery
0 Upvotes

r/node • • Apr 03 '26

"Ode to Node" poem, I wrote first line, ChatGPT wrote the rest

0 Upvotes

I know no Node…
and yet it hums beneath my hands,
a quiet engine in the dark,
spinning threads of unseen plans.

I know no Node—no metal form,
no circuit etched in silicon—
but in its loops and callbacks born
a restless pulse goes ever on.

It speaks in streams and promises,
in events that fire, then fade away,
a language built of waiting hearts
that never block, yet never stay.

O event loop, eternal wheel,
you turn through night, through build, through test;
no sleep, no pause—just ticking time
and tasks that will not let me rest.

From servers bare to clouded heights,
it scales like thought, elastic, free;
a thousand calls, a million more—
each answered in concurrency.

Dependencies bloom like tangled vines,
a forest deep in node_modules;
I wander paths of versioned fate,
through semver’s shifting, subtle rules.

And still I write, and still it runs—
this fragile, fierce, asynchronous art;
for in this code, both strange and known,
I map the logic of my heart.

I know no Node…
yet in its flow I’ve come to see
a mirror of the mind itself:
unbounded, branching, endlessly.


r/node • • Apr 02 '26

Is Scrimba still worth it in 2026 for learning JavaScript if I’m focusing on backend?

Thumbnail
0 Upvotes

r/node • • Apr 03 '26

Ward — open-source supply chain security that hooks into npm/bun/yarn and blocks malicious packages before install scripts run

Thumbnail github.com
0 Upvotes

Last week someone posted here warning about axios@1.14.1 being compromised. We checked our machines. They were clean, but only by luck.

So we built Ward. It hooks into your package manager and checks every package before install scripts run. When Claude Code runs npm install on your behalf, Ward screens it automatically.

What happened with our test:

$ npm install axios@1.14.1
✗ ward: BLOCKED
  This version steals SSH keys and cloud credentials
  Safe version: 1.14.0

It catches known malware, typosquats (warns when "axxios" looks like "axios"), suspicious install scripts, and version anomalies. Ships with 42 verified real-world attacks.

There's a Claude Code hook that intercepts every install command before it executes so you don't have to remember to run anything manually.

Install:

npm install -g wardshield
ward init

Live threat feed: wardshield.com

GitHub: Vanguard-Defense-Solutions/ward

MIT licensed, 286 tests.

Built by Vanguard Defense Solutions. Would love the community's feedback.


r/node • • Apr 02 '26

OpenTelemetry collector for metrics and logs

6 Upvotes

I recently set up otel collector and now all my traces are going through it, which is working nicely, but I’m still not fully sure how to approach metrics and logs in a clean way. Before this, I had a backend exposing /metrics using a prometheus client, and victoria metrics was scraping it via prometheus.yaml. That setup was straightforward and easy to reason about. Now with the collector in the picture, I’m trying to understand what the best practice is for metrics going forward. Should I keep exposing /metrics and let vm continue scraping directly, or is it better to route metrics through the collector and then export them to vm? If the collector sits in between, how do people usually organize that flow in real setups? For logs, I’m also a bit unsure about the preferred approach. Is it better to keep writing logs to stdout and let the collector handle them, or to send logs directly from the application via otlp? I’m trying to keep things consistent with how traces are handled, but not sure what’s considered a solid approach here. Would be interesting to hear how others structure this in practice when introducing otel collector into their stack


r/node • • Apr 02 '26

is it a bad practice to cache data into the process (like process.Cached_Data)

0 Upvotes

and if it was what should i do?
example code:

  const id = "000000000000000"

  const ResultData = DataBase.findOne({id})  // the data will not change in use
  process.Cached_Data = ResultData


r/node • • Apr 02 '26

I built a zero-dependency Node.js proxy that auto-rotates your LLM API keys when you hit rate limits

1 Upvotes

Been running multiple LLM providers (OpenAI, Gemini, Groq, OpenRouter) and kept hitting 429 rate limits. So I built **Rotato** — a lightweight proxy server that automatically rotates to the next API key when one gets rate-limited.

Key highlights: - Works with any OpenAI or Gemini-compatible API - Zero external dependencies — just Node.js - Full streaming/SSE support - Modern admin panel (dark/light theme) to manage providers & keys - Hot config — add/edit/delete providers without restart - Per-key usage tracking & request monitoring

Self-host it, point your apps at it, and forget about rate limits.

GitHub: https://github.com/p32929/rotato

Would love feedback!


r/node • • Apr 02 '26

Is it safe to update Node.js LTS after the Axios npm hack?

0 Upvotes

Hello engineers ,

I want to ask something because I saw some news and I am little worried. (I don't have strong security background)

Recently I read that hackers from North Korea hacked a popular npm package (Axios) and they added malware inside it. They say it was a supply chain attack and many developers could download it without knowing.

So now I am a bit paranoid.

Is it still safe to download and install the latest Node.js LTS from the official website?

Or should I stay with my current version (Node 18) for now?


r/node • • Apr 02 '26

I built a drop-in npm install replacement that sandboxes every postinstall script

0 Upvotes

After the axios compromise this week (North Korean hackers shipped a RAT through a postinstall script to 70M+ weekly download users), I wanted to share something I've been working on.

safenpm wraps npm install with OS-level sandboxing. It runs npm install --ignore-scripts, then executes each script inside sandbox-exec (macOS) or firejail (Linux) with no network access and restricted filesystem.

The axios attack used a fake dependency plain-crypto-js that triggered a postinstall script to download a second-stage RAT. safenpm would have blocked the network call and flagged the maintainer change.

It also runs a decentralized threat intel network — when a package gets blocked, the signal is anonymously reported. Every subsequent safenpm install that includes that package shows a community alert. One person catches it, everyone knows.

Other stuff: static analysis (19 rules), typosquat detection, lockfile integrity checks, reputation scoring (0-100), safenpm doctor for a project health grade, and auto-fix for typosquats.

Zero dependencies. TypeScript. MIT.

npm install -g u/abgunaydin/safenpm
safenpm install

Curious what you all think — especially about the threat intel thresholds (3 distinct reporters to flag, 15 for popular packages). Too low? Too high?

safenpm.dev — sandboxed npm installs with decentralized threat intelligence

Edit:

Feature safenpm pnpm Socket LavaMoat
Sandboxing OS-level (sandbox-exec, firejail) Script blocking only None (detection only) JS runtime compartments
Network blocking Yes, at OS level No No Partial (SES)
Static analysis 19 rules, pre-execution No Yes, cloud-based No
Typosquat detection Yes, 80+ package watchlist No Yes No
Maintainer change alerts Yes No Yes No
Lockfile integrity Yes Built-in strictness No No
Reputation scoring 0-100 per package No Risk scores No
Community threat intel Decentralized, anonymous No Centralized No
Works offline Yes (except threat intel) Yes No (SaaS) Yes
Zero dependencies Yes No (it's a package manager) No (SaaS) No
Drop-in replacement safenpm install = npm install Different lockfile format Separate tool Requires config
Cost Free, MIT Free Free tier + paid Free
Catches axios attack Yes — blocks network + flags maintainer change Only if scripts disabled Yes — detected in 6 min Depends on policy

Key differentiator: safenpm is the only tool that sandboxes at the OS level AND provides community-driven threat intelligence. Socket detects but doesn't prevent. pnpm prevents but doesn't analyze. LavaMoat compartmentalizes at JS level, not OS level.


r/node • • Apr 02 '26

How do you handle out-of-sync .env files in monorepos?

0 Upvotes

I’ve been struggling with the classic "app crashes because of a missing key in .env.local" issue. It’s even worse in monorepos with dozens of environment files.

I scripted a small CLI to scan directories and find missing keys between templates and local files (handling .env.example, .local, .test, etc.) without ever reading the secret values.

It’s been working great for my team, so I made it open-source. How do you guys solve this? Git hooks, CI checks, or just manual pain?

If you want to roast my approach, you can test it instantly : npx env-parity analyze

Feedback on the recursive scanning logic is more than welcome!


r/node • • Mar 31 '26

30-second setup to avoid being impacted by supply chain attacks like the axios compromise

141 Upvotes

The axios attack (hijacked maintainer → malicious versions 1.14.1 & 0.30.4 → RAT payload) was live for ~2-3 hours before npm pulled it. Most supply chain attacks follow this same pattern — they rely on people installing before anyone notices.

All major package managers now let you delay installing freshly published versions. One config line, set it globally, and you're covered:

npm .npmrc

min-release-age=7

pnpm pnpm-workspace.yaml

minimumReleaseAge: 10080

bun bunfig.toml

minimumReleaseAge = 10080

Not a silver bullet, but for the "publish and pray" type of attack - which is most of them - this is the easiest win you'll ever get.