# A month of server hardening, from PHP2Shell to nginx2root

> Between 21 October and 21 November 2026 we went through dozens of Linux servers and more than a hundred web installations, in response to three waves of critical vulnerabilities. This is the technical account of what we did, in what order and with which tools. We do not name clients or specific environments, because what matters is the method.

- Published: 2026-11-24
- Who it is for: Sysadmins and IT managers running Linux servers with PHP and WordPress sites, especially with Laravel Forge and AWS
- URL: https://cloudfactory.it/en/ideas/server-hardening-php2shell-nginx2root-wp2shell/

## The perimeter and the three waves

The perimeter is typical of anyone running hosting and applications for SMEs and public bodies. EC2 instances, both x86 and Graviton (arm64), in the Ireland and Milan regions, mostly provisioned with Laravel Forge. On top, nginx, PHP-FPM, MySQL or MariaDB, Redis or Memcached, and then WordPress and WooCommerce sites, Laravel applications, a Drupal instance, a Node.js bridge for a voicebot and a few Windows servers. Cloudflare sits in front of almost everything.

The month was marked by three events, one of which had started earlier:

| Date | Vulnerability | Component | Fixed versions |
| --- | --- | --- | --- |
| 17 July 2026, exploited for months | wp2shell (CVE-2026-63030 and CVE-2026-60137) | WordPress core, REST API batch endpoint | 6.9.5 and 7.0.2; vulnerable 6.9.0-6.9.4 and 7.0.0-7.0.1 ([Wordfence](https://www.wordfence.com/blog/2026/07/wp2shell-wordpress-exploit-technical-analysis-and-real-attack-data/)) |
| 21 October 2026 | PHP2Shell (CVE-2026-109618 and CVE-2026-109619) | PHP core, unauthenticated code execution, CVSS 9.2 | 8.5.12, 8.4.27, 8.3.36, 8.2.35 ([Laravel Forge](https://laravel.com/forge/docs/knowledge-base/php-security-release-october-2026)) |
| 18 and 19 November 2026 | nginx2root (CVE-2026-123007 and four more) and a new PHP security release | nginx HTTP/2, PHP | nginx 1.31.9 and 1.30.7 ([nginx](https://nginx.org/en/security_advisories.html)); PHP 8.5.13, 8.4.28, 8.3.37, 8.2.36 |

The most serious problem was not a single CVE but the combination. Servers on Ubuntu 20.04, out of standard support. PHP stuck, because the reference repository no longer publishes packages for that Ubuntu release. And WordPress installations with admin tools that should never be in production.

## The method, look first and then touch

Every intervention followed the same protocol, however urgent.

1. **Read-only reconnaissance.** A non-destructive audit script collects the versions of the operating system, kernel, nginx and PHP for each FPM pool, upgradable packages, listening ports, authorised SSH keys, sudo users, cron jobs, active services and indicators of compromise. The output goes into a timestamped file in `/root/`.
2. **Snapshot before changing.** An EBS snapshot of the volume and database dumps before any significant change, such as a MariaDB upgrade, a PHP version switch or a rebuild.
3. **Versioned, verified scripts.** Every script has its version in the name (`cf-<action>-vX.Y.sh`), is tested locally on a copy of Forge's directory layout and is delivered with an MD5 to check on the server. Copy and paste into web consoles mangles long blocks, so in those cases the script travels gzipped, base64-encoded and split into chunks of about 1,100 bytes.
4. **Dry run first, then execution.** Destructive actions always have a test mode. nginx configurations are saved as `.cf-bak` and validated with `nginx -t` before the reload.
5. **HTTP check before and after.** For each site we record the HTTP status before the intervention and compare it afterwards. When switching PHP versions the script rolls back on its own if the status changes.
6. **Fix forward, with approval.** We fix forward rather than restore, and every production change starts only after explicit approval.

We also have an internal rule, no changes on Fridays. We broke it once, for nginx2root, because an exploit was already public and traffic was minimal in the night between Friday and Saturday.

## October, PHP2Shell

On 21 October the PHP team released fixes for two vulnerabilities in the core of the language, related to out-of-memory handling and to global state left dirty between one request and the next. They allow code to run on the server without credentials. Updating is the only complete fix, everything else reduces the surface but does not close the hole. We covered them in [Critical PHP vulnerabilities](https://cloudfactory.it/en/ideas/critical-php-vulnerabilities-october-2026/) and in [PHP2Shell, our perimeter](https://cloudfactory.it/en/ideas/php2shell-perimeter-rescues-rebuilds/).

**Inventory.** On every server we looked at `ls /etc/php/`, `php -v` for each binary, the nginx vhost > FPM socket > PHP version chain, and `apt-cache policy` to see which repository PHP comes from. Each installation went into one of three groups: patchable now, patchable after a system upgrade, not patchable on the current system.

**Patches where possible.** On servers with Ubuntu 24.04 or 26.04 and working repositories we installed 8.3.36, 8.4.27 or 8.5.12 and restarted every pool. On one server apt had been stuck since July because a `mariadb-server-core` upgrade had been interrupted halfway. `apt --fix-broken install` unblocked about 220 packages, MariaDB included.

**Mitigations where PHP could not be updated.** Where PHP was stuck we applied the measures listed in the October advisories from PHP and [CERT-EU](https://cert.europa.eu/publications/security-advisories/2026-018/), at FPM pool level and with `php_admin_value`, so applications cannot override them:

- `session.upload_progress.enabled = 0`;
- `post_max_size` and `upload_max_filesize` reduced to the minimum the site needs;
- memory limits reviewed pool by pool;
- the same treatment for admin panel pools too, not just for the sites.

**Forgotten servers.** The inventory turned up two servers no longer in use but still exposed, one with PHP 7.4. We handled them like this: EBS snapshot, instance stopped, nothing deleted. The same went for a legacy application on PHP 7.0 with a public `phpinfo()` page and for a few default vhosts that answered to any name.

**Mail.** A mail server was not affected by the PHP vulnerability but was behind on versions. We updated it in production, checking the SMTP and IMAP flow straight afterwards.

## Shrinking the network surface

Remote code execution does less damage if nothing else can be reached from the compromised process. This was the largest part of the work, applied to every Linux server.

**Internal services on localhost only.** On several servers MariaDB or MySQL, Redis and Memcached were listening on `0.0.0.0`. Before changing `bind-address` we scanned `wp-config.php` and `.env` files to make sure no active application used remote connections. Then a backup of the configuration file, a targeted `sed`, a `grep` to check, a restart and `ss -tlnp` to confirm. We also removed database users with host `%` where they were not needed.

**Security groups.** Forge creates groups with very open rules. We rewrote them with the AWS CLI:

- 80 and 443 open only to the [IP ranges published by Cloudflare](https://www.cloudflare.com/ips/);
- 22 open only to Forge's IPs and the region's EC2 Instance Connect prefix;
- default “all traffic” rules removed, along with `launch-wizard-*` groups left over from manual launches;
- shared groups split up between unrelated servers that trusted each other.

A useful lesson. Locking 80 and 443 to Cloudflare took a site down for a few minutes because its DNS record was set to “DNS only”, that is, without Cloudflare's proxy in front. Now the proxy status of each record is checked before touching the security group, not after.

**Origin behind Cloudflare.** SSL/TLS in Full (strict) mode with origin certificates, `set_real_ip_from` with Cloudflare's ranges and `real_ip_header CF-Connecting-IP` in nginx, so logs, rate limits and fail2ban see the visitor's real IP. For applications handling personal data we added Cloudflare rules with a Managed Challenge on traffic from outside Italy.

**Instances.** IMDSv2 required (`HttpTokens=required`) on new servers, so an SSRF cannot read the IAM role's credentials ([AWS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html)). Elastic IPs checked before every resize or stop.

**SSH access.** An inventory of the keys in `authorized_keys` for every user, confirming one by one who owns them. We removed a `PasswordAuthentication yes` exception for a single user, added by an attacker on a compromised server.

## Web root hygiene

The most underrated risk we found was not a CVE. It was the files forgotten inside public folders. Backup plugins such as Akeeba, UpdraftPlus, Duplicator and BackWPup protect their archives with `.htaccess`, which nginx ignores entirely.

**What we found.** On several servers, full backup archives in `.jpa`, `.zip`, `.sql` and `.daf` format, with database, `wp-config.php` and salts, inside the web roots, adding up to tens of GB. Plus application installer zips, a 1 GB `debug.log` written for months with `WP_DEBUG` on, phpinfo files, “OLD” copies of sites and a `wp-cli.phar` in a public folder. Everything was moved into quarantine folders under `/root/`, outside the web root, without deleting anything until it had been checked.

> **Technical deep dive: How to really check exposure**
>
> With name-based vhosts, a `curl` to `127.0.0.1` gives false negatives, because the default vhost answers. The correct test forces name resolution on the server itself:
>
> ```bash
> curl -skI --resolve www.example.com:443:127.0.0.1 https://www.example.com/wp-content/backups/archive.zip
> ```
>
> A 200 means exposed. After quarantine and the nginx rules it must become 403 or 404. Where exposure was confirmed we analysed the available logs to see whether anyone had downloaded the file, and the credentials inside were treated as compromised.
>

**Defensive nginx rules.** In every site, inside the `server` block:

```nginx
# no PHP in uploads
location ~* /wp-content/uploads/.*\.php$ { deny all; }

# hidden files, except those for certificates (ACME)
location ~ /\.(?!well-known) { deny all; }

# logs, dumps and backup archives
location ~* \.(log|sql|sql\.gz|jpa|daf|bak|zip|tar|tgz|rar)$ { deny all; }

# internal folders of backup plugins
location ~* /wp-content/(ai1wm-backups|backups?|updraft|backwpup[^/]*)/ { deny all; }
location ~* /wp-content/plugins/akeebabackupwp/app/backup/ { deny all; }

# for non-WordPress PHP applications: vendor/ and application logs
location ^~ /vendor/ { deny all; }
```

One detail that cost us time. With `return 404` some applications had `error_page 404 /index.php`, so the application caught the request and answered 200. With `deny all`, which returns 403, the test result is unambiguous.

## WordPress, taking the tools away from attackers

In the compromises we analysed, the way in was almost always one of two: a file manager plugin or the wp2shell chain in core. We closed both systematically.

**File managers out of production.** WP File Manager, Filester, AceIDE and the like give anyone who gets an admin session, or exploits one of their flaws, a file editor on the server. We searched for them on every site of every server and removed them with WP-CLI, run as the site's owner:

```bash
for r in $(find /home -maxdepth 5 -type d -name wp-includes -printf '%h\n'); do
  o=$(stat -c %U "$r")
  sudo -u "$o" -H wp --path="$r" plugin list --field=name | grep -Ei 'file-manager|filester|aceide'
done
```

**wp2shell.** Besides updating core to 6.9.5 or 7.0.2 and later, we blocked the REST API batch endpoint in nginx on every hosted site, in both forms it can be reached, as security advisories also suggest ([Tenable](https://www.tenable.com/blog/wp2shell-cve-2026-63030-cve-2026-60137-frequently-asked-questions-about-remote-code-execution)). Where a `location` was overridden by other Forge rules we used an `if` on the address:

```nginx
if ($uri ~* "/batch/v1") { return 403; }
if ($args ~* "rest_route=/?batch") { return 403; }
```

> **Real case: The timeline read from a forgotten log**
>
> On a site with an exposed debug log we could reconstruct the story. SQL injection attempts on the batch endpoint from 18 July, the day after the vulnerability was published, a wave of scans between late July and early August, and sporadic attempts until October.
>
> We checked that the site's MySQL user did not have the `FILE` privilege. That rules out at least the most direct route, writing files to the server through the SQL injection. For the rest of the chain, what mattered was the core update and checking users and files.
>

**Fewer plugins, less surface.** We removed deactivated or unused plugins, more than twenty on a single server, inactive themes except one default as a fallback, and premium plugins with expired licences that no longer received updates. Where they were really needed we are replacing them with small, reviewed plugins we write ourselves. A debug snippet that wrote form contents to the logs is gone too.

**Configuration.** `DISALLOW_FILE_EDIT` on everywhere, `WP_DEBUG` off in production, minor core auto-updates turned back on where they had been disabled, and a review of the admin list site by site, confirming who is legitimate.

**OPcache.** On Forge servers `opcache.validate_timestamps` is 0, so after a plugin update through WP-CLI PHP keeps serving the old classes from memory. On three sites this caused 500 errors right after the update. A PHP-FPM reload was not enough, it takes `systemctl restart php8.X-fpm`, which is now part of every update cycle.

## Find, contain, rebuild

On some sites the check found a compromise that had already happened, in some cases months earlier and with several different attackers on the same site. The rule we followed is simple. A compromised site is not cleaned, it is rebuilt.

**Triage.** A set of read-only scripts, each with one job:

- a webshell and backdoor scanner that looks for PHP in `uploads/` and temporary folders, recently modified files outside of updates, and patterns such as `eval(`, `base64_decode`, `gzinflate` and `assert` on POST input;
- a hunter for signatures of known campaigns, fed with the indicators found on the first sites;
- a persistence check: system and user cron jobs, `authorized_keys`, new users, systemd units, unusual processes and outbound connections, FPM crashes and OOM events in the logs;
- `wp core verify-checksums` and `wp plugin verify-checksums --all`, knowing that premium plugins cannot be verified this way and must be compared with snapshots or read by hand.

**What we found.** Recurring indicators, useful to anyone doing the same work:

- fake plugins with believable names, such as a “cache buster” or a Hello Dolly clone, installed in `uploads/` or `plugins/`, with a webshell triggered by a POST parameter;
- ghost administrators, with odd user IDs (for example 123456), several admins sharing the same email, or accounts created directly in the database;
- a webshell plugin hidden from the plugin list, with a hardcoded API key;
- SEO spam injected into pages for years, visible only by comparing archived versions;
- an SSH exception for password login, added by the attacker.

In no case did we find persistence at root level.

**Containment.** Vhost disabled, the site's PHP-FPM stopped, forensic collection (suspicious files, logs, dumps) into a quarantine folder with hashes, removal of rogue admins with their content reassigned, sessions and application passwords invalidated.

**Isolation between sites.** On one server the permissions let one site read the other sites' `wp-config.php`. We fixed them with homes at `711`, configuration files at `640`, one FPM pool per user and `open_basedir` limited to the site's folder.

**Rebuilding from clean sources.** From the old site we take only the data, never the code:

1. **Core and plugins from official sources.** WordPress downloaded from wordpress.org, plugins from the official repositories or the vendor's packages.
2. **Filtered uploads.** Uploaded files go through a filter that discards anything that is not media.
3. **Custom code reread.** Theme and custom code are reviewed file by file before being copied.
4. **Database checked.** Database imported, users and options checked, salts regenerated.
5. **Configuration outside the web root.** `wp-config.php` moved out of the public folder.

**Credential rotation.** Database passwords, WordPress salts, passwords of every administrator (not of the shops' end customers) and API keys found in `wp-config.php` files: SMTP and SES, payment gateways, newsletter platforms, integrations. AWS keys were revoked in IAM, not just changed in the file.

**User cleanup.** On one online shop we removed about 1,700 fake accounts created by bots. The first criterion we tried was too broad, the second too narrow. In the end we combined several signals, namely billing address, order history and confirmed newsletter subscription.

**When a rebuild is not possible.** One site had a commercial theme that could no longer be updated, incompatible with PHP 8.3, and an active backdoor. WordPress stayed off and a static version is online instead. Two Python scripts fetch the pages from the Wayback Machine and strip the injected spam before publishing.

## New servers instead of patched ones

For servers on Ubuntu 20.04 we decided not to upgrade in place but to build new machines and move the sites one at a time.

**The base.** Ubuntu 26.04 or 24.04 LTS on Graviton (t4g), MySQL 8.4 instead of MariaDB on new servers, PHP 8.4 as the reference version, Ubuntu Pro with ESM and Livepatch, IMDSv2, security groups locked to Cloudflare and management IPs from the first minute, Cloudflare origin certificates in strict mode and an isolated Linux user for each site. The region is whichever suits the data best, because with Cloudflare's proxy in front the latency to the origin matters little.

**PHP 8.4 with automatic rollback.** Before migrating we listed the WordPress version of every site, because old cores do not cope with PHP 8.4. The version switch script saves the pool, changes socket, reloads, compares the HTTP status and looks for fatal errors in the logs. If anything changes it rolls back on its own. Two sites rolled back, one because of a `create_function()` removed in PHP 8, fixed by hand and then migrated again.

**Migration in three scripts**, one per phase:

1. **export.sh, on the old server.** Database dump, cleaned of the MariaDB sandbox mode lines that MySQL 8.4 rejects, and an archive of the uploads.
2. **pull.sh, on the new server.** Transfer into a quarantine folder.
3. **import.sh.** Rebuild of the site from clean sources, as above, and import of the filtered data.

The DNS switch happens on Cloudflare, and the old site is disabled right afterwards. For servers with dozens of sites the plan uses the old server as a reverse proxy to the new one during the transition. That way each site moves to updated PHP as soon as it is migrated, without touching DNS, and the Elastic IP moves at the end.

**Backups.** Left to automatic EC2 snapshots instead of plugins inside WordPress. No archives in the web root, and a restore that does not depend on the site you are trying to save.

## Transactional email

Amazon SES SMTP credentials found in the configuration files of compromised sites had to be treated as burnt. We recreated them with a different approach:

- a dedicated IAM user for each domain, with a policy that only allows `ses:SendRawEmail` from that domain's verified identity;
- SMTP credentials derived from that user and stored only on the server, outside the web root;
- an SMTP endpoint in an SES region that offers one, because not all of them do;
- DKIM, SPF with `include:amazonses.com` and DMARC on Cloudflare, with DMARC starting at `p=none` to collect reports and then moving to `quarantine`;
- a request to leave the SES sandbox that declares every real use, newsletters included.

Twice during the work a password ended up in plain text in a channel it was not meant for. Both times we changed it immediately, without stopping to weigh whether it was “probably” a problem.

## November, nginx2root and patching with Systems Manager

On 18 November nginx released fixes for five vulnerabilities grouped under the name nginx2root. The most widespread, CVE-2026-123007, is a flaw in HTTP/2 flow control present since nginx 1.9.5, that is since 2015, and having HTTP/2 on is enough to be exposed ([CERT-EU](https://cert.europa.eu/publications/security-advisories/2026-022/)). The next day brought a new PHP security release, with seven critical vulnerabilities ([The Register](https://theregister.com/patches/2026/11/18/another-critical-php-security-release-has-dropped/5310911)). This time we did not want to repeat the work server by server from the console.

**Systems Manager across the fleet.** No instance was registered in AWS Systems Manager. We enabled Default Host Management Configuration, which registers instances without assigning an IAM role to each one ([AWS](https://docs.aws.amazon.com/systems-manager/latest/userguide/fleet-manager-default-host-management-configuration.html)). Where the agent would not start we reinstalled it from the official `.deb` package. From CloudShell, Run Command runs the same script on every Linux instance:

```bash
export AWS_PAGER=''
jq -Rs '{commands:[.], executionTimeout:["3600"]}' cf-audit.sh > params.json
aws ssm send-command --document-name AWS-RunShellScript \
  --instance-ids <i-...> <i-...> --parameters file://params.json
aws ssm get-command-invocation --command-id <id> --instance-id <i-...>
```

**nginx.** In the first days the distributions' packages did not have the fix yet, and a fully updated Ubuntu 26.04 still reported a vulnerable version. Ubuntu then published fixed packages with [USN-9159-1](https://ubuntu.com/security/notices/USN-9159-1). Where possible we moved to the official nginx.org repository, mainline branch (1.31.9), checking after the switch that HTTP/2 and Forge's configurations worked. Where switching repository was not immediate we applied the temporary mitigation given in the advisories, `http2 off` in the exposed `server` blocks. Turning HTTP/2 off closes two of the five vulnerabilities, not the others, so it remains a bridge to the update.

**PHP.** Updated to 8.3.37, 8.4.28 or 8.5.13 where available. On servers still waiting for migration the October mitigations stay in place, plus `fastcgi_keep_conn` turned off where it was on. Connection reuse between nginx and PHP-FPM is the condition that makes the most serious of the November vulnerabilities, CVE-2026-129289, exploitable ([BleepingComputer](https://www.bleepingcomputer.com/news/security/php-security-updates-fix-18-flaws-including-critical-rce-bugs/)). On some servers we moved the PHP package source from the Launchpad PPA to packages.sury.org, because the PPA is being retired.

**Kernel and reboots.** Full upgrade and reboot of every Linux server, one at a time, comparing each site's HTTP status before and after. Reboots go through `aws ec2 reboot-instances` and not `shutdown -r` inside Run Command, which proved unreliable on Ubuntu 26.04.

**Automatic updates.** On aligned servers we extended unattended-upgrades to the nginx.org and Sury origins, deliberately leaving out repositories for components that need testing, such as Redis and Node.js. Ubuntu Pro is attached with separate tokens for each organisation that owns servers, not a single token. The next step is Patch Manager, with a fixed window at the start of the week.

**A reusable procedure.** The whole round became a written procedure: reconnaissance, a table per server with the proposal, approval, interventions one at a time, check, close. We then applied it to other AWS accounts we manage as well.

## Custom applications, beyond CVEs

For custom-built applications, the dependency audit is only half the job. On a Node.js and Laravel bridge for a phone voicebot we did this:

- `npm audit --json` filtered by severity, direct or transitive dependency and availability of a fix; for Composer, with Packagist unreachable from the server, queries to the GitHub Advisory API with the lockfile versions, cross-checked on OSV.dev;
- an assessment of each CVE's real exposure in the code: the WebSocket library was the real risk, because the endpoint was public with no message size limit, while other findings were not reachable;
- problems no scanner reports: an endpoint issuing tokens with no authentication or rate limit, one sending emails with arbitrary content (a spam vector), WebSockets accepted without authentication, dashboard credentials in the code instead of in `.env`;
- fixes prepared on a separate branch, so the automatic deploy would not reach production before testing.

On a Laravel application server the review also led us to fix permissions and `LOG_LEVEL` in the production `.env`, and to put an nginx monitoring block that had been left public behind authentication.

## Details that cost us time

Small things, each able to make an intervention fail without anyone noticing.

| Situation | What happens | What we do now |
| --- | --- | --- |
| Layout of Forge's nginx configurations | It changes from server to server, with folders by site name or `forge-conf/<numeric-id>/` | We check it every time and never assume it |
| Rules written in vhost files | A change from the Forge panel overwrites them | Rules in dedicated include files where possible, with exceptions documented |
| `sites-enabled` contains symlinks | `grep -r` does not follow them | `grep -R` |
| Server marked “disconnected” by Forge | On reboot AWS puts back the prefix in `/root/.ssh/authorized_keys` that blocks root login | Check the file after every reboot of a Forge server |
| Plugins updated with WP-CLI | With OPcache not checking timestamps, the old classes stay in memory | Restart PHP-FPM, do not reload |
| Password reset with `--skip-plugins` | The security plugin does not log the change and then flags the admin as unknown | Note the reset and check the account before dismissing the alert |
| Run Command output | `list-command-invocations` truncates it to 2,500 characters | `get-command-invocation` |
| Blocks pasted into bash | `!!` and `!` get expanded by history | `set +H` at the top of every block |
| Several terminals and accounts open | Output from the wrong server, console on the wrong AWS account | Read the prompt in the output and the account ID before every action |
| A diagnostic `curl` | It triggered a cached path to an orphaned installation and took a site offline for 15 minutes | Orphaned installations moved out, transients cleared |

## Next steps

The emergency work is done. The structural work remains:

- finish migrating the last environments to current LTS releases and PHP 8.4;
- Patch Manager with a fixed weekly window at the start of the week and compliance reports;
- move every managed site's domain to Cloudflare DNS before moving the sites, so security groups can stay locked everywhere;
- an internal monitoring system that flags vulnerable versions, new files in web roots and added administrators, with our team acting on every alert;
- periodic review of IAM accounts and keys, removing long-lived static ones.

If you have a WordPress site you suspect has been hacked, the [Hacked WordPress site](https://cloudfactory.it/en/services/hacked-wordpress-site-cleanup-security/) page explains how we work. If you run servers with the same problems, [write to us](https://cloudfactory.it/en/contact/) and we will start with a read-only reconnaissance.

## How we wrote this article

At Cloudfactory we also use artificial intelligence in our editorial work: it helps us find and cross-check sources, compare data, set up the structure and polish the language. The system we use is configured by us, with instructions, examples and procedures built around the way we write. This article comes from the month's operational notes. Client names, domains, IP addresses and resource identifiers have been removed, and commands are shown in generic form. Our team checked every source, edited the text and approved the published version. The assessments and choices are Cloudfactory's, and we answer for them.

## Frequently asked questions

### Is updating PHP and nginx enough to be safe?

Updating is the only complete fix, but it is not enough. Processes must be restarted, you need to check nobody got in before the patch, and you should shrink what an attacker would reach if they did: database and cache on localhost only, web ports open only to Cloudflare, no backups in public folders.

### Does turning off HTTP/2 protect against nginx2root?

Only in part. `http2 off` blocks CVE-2026-123007 and CVE-2026-123633, the two that involve HTTP/2, but not the other three. It is a temporary measure until nginx 1.31.9, 1.30.7 or the distribution's fixed package.

### Are WordPress backups in the web root a risk?

Yes, especially with nginx. Plugins such as UpdraftPlus, Duplicator or Akeeba protect archives with `.htaccess`, which nginx does not read. If the archive contains the database and `wp-config.php` and answers with a 200, anyone who knows or guesses the path can download it.

### Can a compromised WordPress site be cleaned?

We do not do it. When there are backdoors, ghost admins or fake plugins we rebuild from clean sources: core and plugins from official sources, custom code reread, only the data from the old site, and every credential changed.

### Why new servers instead of upgrading Ubuntu 20.04?

An in-place upgrade across several releases carries along configurations and problems built up over the years. A new server starts locked down, with a supported system and PHP 8.4, and sites move one at a time with the option to roll back.

## Sources

- [Wordfence, WP2Shell WordPress Exploit Technical Analysis and Real Attack Data (July 2026)](https://www.wordfence.com/blog/2026/07/wp2shell-wordpress-exploit-technical-analysis-and-real-attack-data/)
- [Tenable, wp2shell (CVE-2026-63030, CVE-2026-60137): frequently asked questions](https://www.tenable.com/blog/wp2shell-cve-2026-63030-cve-2026-60137-frequently-asked-questions-about-remote-code-execution)
- [NVD, CVE-2026-63030](https://nvd.nist.gov/vuln/detail/CVE-2026-63030)
- [Laravel Forge, PHP security release, October 2026](https://laravel.com/forge/docs/knowledge-base/php-security-release-october-2026)
- [CERT-EU, Security Advisory 2026-018 (PHP)](https://cert.europa.eu/publications/security-advisories/2026-018/)
- [PHP, News archive 2026](https://www.php.net/archive/2026.php)
- [nginx, security advisories](https://nginx.org/en/security_advisories.html)
- [CERT-EU, Security Advisory 2026-022, Critical vulnerabilities in Nginx](https://cert.europa.eu/publications/security-advisories/2026-022/)
- [Lovguiden, CERT-EU: five critical nginx vulnerabilities](https://www.lovguiden.dk/en/det-offentlige/cert-eu-cybersikkerhedstjeneste/2026-11-18-five-critical-nginx-vulnerabilities-allow-unauthenticated-remote-code-execution)
- [Ubuntu, USN-9159-1: nginx vulnerabilities](https://ubuntu.com/security/notices/USN-9159-1)
- [The Register, Another critical PHP security release has dropped (November 2026)](https://theregister.com/patches/2026/11/18/another-critical-php-security-release-has-dropped/5310911)
- [BleepingComputer, PHP security updates fix 18 flaws, including critical RCE bugs (November 2026)](https://www.bleepingcomputer.com/news/security/php-security-updates-fix-18-flaws-including-critical-rce-bugs/)
- [Cloudflare, IP ranges](https://www.cloudflare.com/ips/)
- [AWS, Configure the Instance Metadata Service options (IMDSv2)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html)
- [AWS, Systems Manager Default Host Management Configuration](https://docs.aws.amazon.com/systems-manager/latest/userguide/fleet-manager-default-host-management-configuration.html)

---

Cloudfactory S.r.l., Rome. Contact: hello@cloudfactory.it
