DEV Community

Ilia Dubovskii
Ilia Dubovskii

Posted on Originally published at beamreach.ai

React2Shell post-mortem: four days with an attacker inside, and every alert firing

In December 2025 an attacker used React2Shell (CVE-2025-55182) to get code execution in one of our containers on a Friday night, and containment finished on the following Tuesday night: four days. Monitoring did not fail. CPU, outbound traffic and AWS cost alerts all fired, and all of them were explained as a database migration. This is the blameless post-mortem of the React2Shell incident: what happened, why each alert was reasonable to dismiss, and what we changed.

Last checked: 25 November 2026. Written by Ilia Dubovskii, founder of Beamreach. Details are anonymised and simplified.

The short version

  • React2Shell (CVE-2025-55182) gave an attacker code execution in one of our containers on a Friday night in December 2025.
  • The attacker read the secrets from .env, used them to reach the database, and tried to export data.
  • Three kinds of alert fired: CPU at 95%, an outbound traffic spike, and AWS Cost Anomaly emails. The engineer on call explained them as a database migration that week.
  • Nobody looked again until Monday, and containment finished on Tuesday night.
  • The alerts worked. They measured symptoms, and symptoms have innocent explanations.
  • We added decoy credentials to every container and one automatic response that can be undone. Ten months later the same kind of attack was contained in under two minutes.

React2Shell in brief

React2Shell is CVE-2025-55182, an unauthenticated remote code execution flaw in React Server Components. The React team disclosed CVE-2025-55182 on 3 December 2025 with a CVSS score of 10.0. One crafted HTTP request to a server function endpoint is enough to run code on the server, and no login is needed.

Component Affected First fixed releases
react-server-dom-webpack, -parcel, -turbopack 19.0.0, 19.1.0, 19.1.1, 19.2.0 19.0.1, 19.1.2, 19.2.1
Next.js (App Router) 15.x and 16.x before the fixed releases; 14.3 canaries from 14.3.0-canary.77 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7, 16.0.7

The first fixed releases are the floor, not the target. Follow-up CVEs in React Server Components were disclosed after 3 December 2025, so upgrade to the latest patch release on your line. Versions, the not-affected list and the upgrade steps are on our React2Shell page, in the React advisory and in NVD.

Timeline

The setup was ordinary: apps in containers, in a private network, behind a load balancer. This timeline is by day. Clock times for the React2Shell incident are not published, so there are none here.

When What happened
Before Dependabot pull requests are open and waiting to be merged.
Friday night The attacker gets code execution through React2Shell. The attacker reads the secrets from .env, uses them to reach the database, and tries to export data.
After the attack starts Alerts fire: CPU at 95%, an outbound traffic spike, AWS Cost Anomaly emails. The engineer on call has a plausible explanation, a database migration that week, acknowledges the alerts and goes on with the weekend.
Until Monday Nobody looks again.
Tuesday night Containment finishes: four days with an attacker inside.

What the attacker did

The exploit gives code execution as the Node.js process. What came next followed the pattern in the public React2Shell reports, and it has three steps.

  1. Download and run a binary. In the public reports this was a one-liner that fetches a file with busybox wget, makes it executable and runs it. Cryptominers and botnet agents were common payloads.
  2. Read the environment. Environment variables and .env files hold database passwords, cloud keys and API tokens. Reading them costs the attacker nothing, so it happens first.
  3. Use what was found. Connect to the database, call the cloud API with the keys, and try to move data out.

In the React2Shell incident on our side, the attacker read the secrets from .env, used them to reach the database, and tried to export data.

The containers were in a private network behind a load balancer. React2Shell needs only one HTTP request to the application, and the database credentials were in .env inside the container.

What our monitoring showed

Three kinds of alert fired during the React2Shell incident. The alerts worked. The explanation given for them was a database migration that week. The table is general reasoning about why a migration would explain each alert. It is not a record of what was said at the time.

Alert What it says Why a migration would explain it
CPU at 95% A container is working hard A database migration would explain a busy container
Outbound traffic spike More data than usual is leaving A migration would explain data moving
AWS Cost Anomaly emails Spend is higher than expected A migration would explain more compute and more traffic, and both cost money

None of the three alerts said what was happening. A CPU alert says a container is busy. It doesn't say who is making it busy. The alerts measured symptoms, and symptoms have innocent explanations.

Contributing factors, and what went well

This is a blameless post-mortem. The engineer on call saw the alerts, had a plausible explanation and acknowledged them. These are the conditions around that decision.

  • Dependabot pull requests were waiting to be merged. A dependency update protects nothing until it is merged, built and running. Ours were in a queue.
  • Our alerts measured symptoms. CPU, traffic and cost are effects. Many causes produce them, and almost all of those causes are harmless.
  • A plausible innocent explanation existed. The engineer on call explained the alerts as a database migration that week.
  • It was a weekend. Once the alerts were acknowledged, nothing brought them back in front of a person until Monday.
  • No signal pointed at intent. Nothing we had could say "this is an attacker" without a person investigating first.

What went well

  • The alerts fired, and a person saw them and acknowledged them.
  • Afterwards we didn't add more alerts. We added one signal that has no innocent explanation.

What we changed, and how it performed

We kept every alert and added four things.

  • Decoy credentials in every container's environment. A decoy AWS access key and a decoy database login sit next to the real ones. The application never reads them. The AWS key belongs to an IAM user that is denied every action, so using the key does nothing except leave a CloudTrail record.
  • One decoy per task definition. Each decoy is planted in exactly one place, so the key that was used names the workload that was compromised.
  • An automatic response that can be undone. When a decoy is used, the agent restarts that task and a clean container replaces the compromised one. If the trigger was a mistake, the cost is a few seconds of capacity. The agent is Compass, which is open source (Apache 2.0).
  • Alerts kept as context. CPU, traffic and cost alerts stay on. When a decoy is used, the alerts explain what the attacker was doing. The decoy decides, the alerts explain.

The decoy is aimed at step 2 of the attacker's pattern. Reading the environment and trying what is there is the most predictable move after the shell, and nobody legitimate uses a credential that the application itself never reads.

Ten months later: PHP2Shell

In October 2026 an attacker got code execution in one of our PHP containers on AWS Fargate through PHP2Shell, read the environment and tried the decoy AWS key. The alert was in Slack in under a minute, the task was restarted within another minute, and nothing was harmed. That incident has its own write-up: PHP2Shell contained in under two minutes.

React2Shell, December 2025 PHP2Shell, October 2026
First signal CPU, traffic and cost alerts A decoy AWS key was used
Innocent explanation available Yes, a database migration No
Who decided The engineer on call Nobody had to
Time to containment Four days Under two minutes

What the changes do not do

Decoy credentials don't stop the exploit and don't patch anything. A restarted container runs the same image, so the attacker can come back through the same bug until the fixed version is deployed. A decoy also sees nothing if the attacker never touches it. And I can't prove the decoys would have caught the React2Shell attacker in December 2025. The attacker read .env and used the credentials that were there, which is the move a decoy is built for, but that is a reconstruction and not a test.

What we would tell another team

  1. Read your last dismissed alert and ask what else could have caused it. If the list of harmless causes is long, the alert can't carry an automatic response.
  2. Put at least one signal in every workload that has no innocent explanation. A decoy credential in the environment is one. The Terraform is in AWS canary credentials: how to set up an IAM honeytoken.
  3. Plant each decoy in one place only. The alert should name the workload without an investigation.
  4. Automate only a response you can undo, and only on that near-certain signal. A restart qualifies.
  5. Keep the alerts. When a decoy is used, the alerts become the context around it.
  6. Merge the dependency pull requests. Decoys shorten the time an attacker stays, and only the patch closes the door.
  7. Write the post-mortem without a name in it. Our alerts worked, and they measured symptoms.

FAQ

How long did the React2Shell incident take to contain?
Four days. The attacker got code execution through React2Shell (CVE-2025-55182) on a Friday night in December 2025, nobody looked at the alerts again until Monday, and containment finished on Tuesday night.

Why were the React2Shell alerts dismissed?
The alerts were CPU at 95%, an outbound traffic spike and AWS Cost Anomaly emails. The engineer on call had a plausible explanation, a database migration that week, and acknowledged the alerts. None of the alerts said what was happening.

What did the attacker do after exploiting React2Shell?
The attacker read the secrets from .env, used them to reach the database, and tried to export data. This matches the public React2Shell pattern: download and run a binary, read environment variables and .env files, then use the credentials.

Would a private network have stopped React2Shell?
It did not stop it for us. Our containers were in a private network behind a load balancer. React2Shell needs only one unauthenticated HTTP request to the application.

What changed after the React2Shell incident?
Every container got a decoy AWS access key and a decoy database login, one decoy per task definition, with an automatic restart of the task when a decoy is used. The existing alerts stayed as context. In October 2026 the same setup contained a PHP2Shell attack in under two minutes.

Sources


This article was first published on beamreach.ai. It was drafted with AI assistance and reviewed by the author.

New critical and exploited vulnerabilities, one page each with checks and fixes: CVE Watch.

Top comments (0)