My mail server ran a vulnerable PHP from the “PHP2Shell” leak on 20th October until 07:15 UTC on the 22nd. One scanner identified itself. The scanner’s request got a 301 from nginx’s HTTP→HTTPS redirect, never reached PHP, and the scanner didn’t follow the redirect. The box is now patched and nothing in the logs, process table or filesystem points to a compromise.
The bugs
Two flaws in the PHP interpreter itself, CVSS v4.0 9.2 each:
- CVE-2026-109618. Out-of-memory handling can abort a request while internal request state is half-initialised. A later request on the same worker then trusts that state. The trigger is an oversized
application/x-www-form-urlencodedPOST. - CVE-2026-109619. Request-owned state outlives the memory behind it. One route in is session upload progress (
session.upload_progress.enabled, on by default) combined with a multipart upload.
Every PHP version back to 5.4 is affected by at least one of them. Upstream fixed 8.5.12, 8.4.27, 8.3.36 and 8.2.35. For 7.4, 8.0 and 8.1 the PHP security team published source-only backports and no releases. Details leaked on 20th October, the release came on the 21st at 14:00 UTC, and Amazon’s MadPot honeypots recorded an exploitation attempt on the 17th, while the bugs were still under embargo.
The bug is in the interpreter, so application authentication doesn’t help. Any request that reaches PHP-FPM counts.
Why this box was exposed
Mail-in-a-Box v60+ on Ubuntu 22.04 runs Roundcube, Nextcloud and Z-Push on php8.0-fpm from ppa:ondrej/php. PHP 8.0 is end of life. By default, unattended upgrades only install from Ubuntu’s own security pocket, so a PPA fix sits there until someone runs apt by hand.
php8.0-fpm:
Installed: 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Candidate: 1:8.0.30-25+ubuntu22.04.1+deb.sury.org+1
Containment first
Stop PHP, then decide:
sudo systemctl stop php8.0-fpm
sudo systemctl mask php8.0-fpm # so apt or the MiaB setup script can't restart it
This takes the webmail, Nextcloud and ActiveSync down, and nothing else goes with them. Postfix, Dovecot, DNS and the /admin panel (gunicorn) don’t use PHP. Mail kept flowing and IMAP clients never noticed. Phones syncing over ActiveSync did.
Mail-in-a-Box regenerates /etc/nginx/conf.d/local.conf whenever it touches the web config, so hand edits there don’t survive. A separate http-level file does:
# /etc/nginx/conf.d/00-maintenance.conf
error_page 502 504 =503 /maintenance.html;
add_header Retry-After 3600 always;
With FPM stopped, every PHP location returns 502, and this turns it into a 503 with a static page. nginx -T | grep error_page showed one directive, so nothing overrides it.
The add_header line was decoration. nginx only inherits add_header into blocks that set no add_header of their own, and the MiaB HTTPS server blocks set Strict-Transport-Security. Retry-After was almost certainly never sent. Nobody’s mail client checks it anyway.
The HTTP→HTTPS redirect stayed on. It doesn’t involve PHP, and it turned out to be what stopped the scanner.
Patching
sudo apt install --only-upgrade 'php8.0*'
That upgraded 19 packages. php -v reports 8.0.30 both before and after, so it can’t tell you whether you’re patched. Only the Debian revision and the changelog can:
$ zgrep CVE-2026-10961 /usr/share/doc/php8.0-fpm/changelog.Debian.gz
+ [CVE-2026-109618, CVE-2026-109619]: Avoid state corruption via
Before the upgrade, the same command printed nothing.
Was anything reached?
nginx doesn’t log request bodies, so the evidence has to come from side effects. Logs went back to 15th October.
The scanner. One hit on the tool’s user agent:
85.11.167.243 - - [21/Oct/2026:08:42:06 +0000] "GET /index.php HTTP/1.1" 301 162 "-" "-"
85.11.167.243 - - [21/Oct/2026:08:42:07 +0000] "POST /index.php HTTP/1.1" 301 162 "-" "php2shell-scan/109618"
Both requests went to port 80 and both got the 162-byte redirect, with nothing from that address over HTTPS afterwards. The same IP had sent GET / with a fixed desktop Edge user agent on the 19th and again on the 21st, which looks like a person checking the target before and after the probe. The probe itself went over plain HTTP and didn’t follow a 301, which is bulk-scanner behaviour.
Out-of-memory fatals. The 109618 path ends in an OOM fatal, and fatals show up as 5xx responses. Across the whole period there was one POST that ended in a 500, 502 or 504. It was a Roundcube _action=refresh poll that returned 502 on the 17th, 15 seconds after a Mail-in-a-Box setup run rewrote Roundcube’s files, while FPM was restarting. Allowed memory size in the nginx error log: none. SIGSEGV, exited on signal or core dumped in the FPM log, journal or dmesg: none. The only signal was one SIGUSR1 on Sunday the 18th, which is the weekly logrotate.
Processes and persistence. With FPM stopped, www-data owned the nginx worker (restarted by needrestart during the upgrade) and an APM daemon started before the leak, which talks only to its vendor’s collector range. There were no shells, no interpreters, no www-data crontab and no /var/www/.ssh, and /dev/shm was empty.
Code. Seven PHP files under Roundcube and Nextcloud had changed since the 15th. The three that aren’t config files are root:root 644 and were written within 1.4 seconds of each other at 12:53 on the 17th, which is the setup run again. A process running as www-data can’t modify root-owned 644 files. The config files changed in the same setup run. www-data itself had written only logs, the Roundcube SQLite database and a regenerated .htaccess. occ integrity:check-core passed.
| Indicator | Result |
|---|---|
| Scanner reached PHP | No, it was redirected at HTTP and didn’t follow |
| OOM fatals, worker crashes | None |
Unexpected www-data processes or sockets |
None |
| Cron, SSH keys, temp-dir droppers | None |
| Modified application code | Only the 17th’s setup run |
| Nextcloud core integrity | Pass |
One gap remains. Wiz showed the bugs can read worker memory without crashing anything, and that leaves no trace in these logs. With no sign of an exploit attempt reaching PHP, I didn’t think a password rotation was justified. Clearing Roundcube’s session table costs one SQL statement, and I’d do that before anything bigger.
Turning Nextcloud off wouldn’t have helped
I considered disabling Nextcloud and dropped the idea. Its largest single source of requests is 127.0.0.1, most likely Roundcube’s CardDAV plugin, which uses Nextcloud as the contacts store with each webmail user’s credentials. That would explain why accounts show recent logins from people who have never opened /cloud. Disabling it would have broken webmail contacts without making the box any safer. Roundcube runs on the same FPM pool, and a Nextcloud in maintenance mode still hands every /cloud request to PHP so PHP can say it’s in maintenance.
The review turned up one real problem: a local Nextcloud root admin last used in January 2018. It’s being disabled.
If you run Mail-in-a-Box
sudo apt update
apt-cache policy php8.0-fpm # want 1:8.0.30-25 or later
sudo apt install --only-upgrade 'php8.0*'
sudo systemctl restart php8.0-fpm # restart, not reload: replace every worker
zgrep CVE-2026-10961 /usr/share/doc/php8.0-fpm/changelog.Debian.gz
- That last command has to print an entry naming both CVEs.
php -vwon’t change. - If your mirror doesn’t have
-25yet,systemctl stopandmaskphp8.0-fpmand wait. Mail and/adminkeep working; webmail, Nextcloud and ActiveSync don’t. - To look for attempts, grep the access logs for
php2shell-scanand the error log forAllowed memory size. Also look for repeated500s after multipart POSTs, oversizedPHPSESSIDcookies and unexplained worker restarts. A clean grep means no indicators found, not that nobody tried.
The same steps are in my reply on the Mail-in-a-Box forum.
Net
What protected this box was a redirect that had nothing to do with security, plus a scanner too lazy to follow it. The structural problem is still there: the most internet-facing code on the server comes from a PPA that unattended upgrades ignore, built on a PHP branch whose upstream no longer cuts releases. The PPA origin is going on my monitoring list, and the server moves to PHP 8.3 when Mail-in-a-Box ships for 24.04.