METABYTE
Back to articles

React2Shell: How an npm Package Almost Killed Trust in Open Source

A developer stumbled upon a malicious npm package posing as React — and it could have happened to anyone.

9 mai 20262 min read
React2Shell: How an npm Package Almost Killed Trust in Open Source

Ever looked at your dependency list and thought, "React is sacred, no one would dare mess with it"? Well, think again. A developer discovered that an npm package named react2shell wasn't a new library for terminal rendering, but a Trojan horse ready to execute any command an attacker wanted.

How It Works

The package mimics the popular React, but upon installation, it runs a script that opens remote access to your machine. No magic: just malicious code in a postinstall hook. It's like calling a plumber who turns out to be a burglar.

Developer Lachlan (yes, the guy from New Zealand) noticed something was off when the package in his project started downloading binaries. He raised the alarm in time, and the package was removed from the registry. But the question remains: how many more such "reacts" are lurking in npm?

This story is a great reminder that open source runs on trust and code review. Don't be that developer who installs a package without checking its contents. Use npm audit, scrutinize dependencies, and think twice before installing "React 2.0" with 5 stars and zero downloads.

METABYTE studio's comment: We've always said: trust, but verify. Especially when it comes to dependencies. Our code audits will help you sleep soundly, without fear of a "react2shell" sneaking into your production.

NEXT STEP

Liked the approach?

We apply the same principles to client projects: AI, automation, products that don't die after launch.