Advice/Quick requirements related to the PHP vuln?

CERT-EU - Critical Vulnerabilities in PHP this was just published today. Is there any advice on what to do right now to avoid exposing MIAB’s php-based services until we understand the patching/update requirements? Is it just roundcube that is affected?

2 Likes

for now i’ve just blocked port 80 and 443 on the server, i figure a few days of no webmail and no personal (static) website won’t hurt anybody. nobody reads my personal site anyways :slight_smile:

This mentions potential mitigation.

Disable session.upload_progress.enabled.

Where tho?.. There’s roundcube, there’s nextcloud. This is all in some default php config somewhere?

Easiest advice I’ve seen so far is to simply disable your web service if you can.

systemctl stop nginx on your MiaB will do the needful and you can simply turn it back on later when the patch is released.

yeah ended up blocking port 80 and 443 in all the firewalls.

There is a PHP fix available. But on my (default) MiaB server running php 8.0; can I just upgrade to php 8.4 or does that brakes something?

I was having trouble with our current php ubuntu repo, https://ppa.launchpadcontent.net/ondrej/php/ubuntu. After some digging I found comments saying that repo was being migrated over to https://packages.sury.org/php/. I followed these instructions to remove the old repo and add the new repo:

sudo add-apt-repository --remove ppa:ondrej/php
curl -sSL "https://packages.sury.org/php/README.txt" | sudo bash

Then I ran sudo apt update and saw that there was an update, dated today, for php8.0 available. I’ve applied those updates and things seem fine.

I’m having trouble confirming that this update does indeed fix php2shell, but it would appear that someone backported the fix to php8.0 even though it’s EOL.

3 Likes

if i download it from the repo you linked that seems to be the new one

hxxps://packages.sury.org/php/pool/main/p/php8.0/php8.0-common_8.0.30-25+0~20261021.88+ubuntu22.04~1.gbpabebea_amd64.deb

and check inside it - it would seem so according to the change logs

zcat /tmp/php80-check/usr/share/doc/php8.0-common/changelog.Debian.gz | grep -iE ‘CVE-2026-109618|CVE-2026-109619|php2shell’

  • [CVE-2026-109618, CVE-2026-109619]: Avoid state corruption via

will await an update tho, just to be sure to fix it all

1 Like

Here’s the backport to the 8.0 source: GitHub - php/php-src at PHP-8.0-CVE-2026-109618-109619 · GitHub

1 Like

seems this is a temp fix that helps mitigate it
session.upload_progress.enabled = off in php.ini

at least according to Urgent PHP vulnerabilities, Cloud Containers being fixed – SiteHost

Which might mess with file uploads via Roundcube to mail attachments but ‘might’ be safer for now??? I guess you decide…

In the 26.04 proposal, we have already taken the liberty of migrating to the new repository. As a mitigation step, that would appear to be a good fix. Though, when a new version of miab is released, the setup will overwrite the mitigation, so keep that in mind.

I may end of upgrading my server as a means ti test a real server on Ubuntu 26.04, though, I really want to work on making migrations easier.

As I understand it now that the PHP updates are out, that config change only helps with one RCE that was announced, but not the other one.

However, this information is coming to me second-hand, so do with it what you will.

In my instance, I’ve removed the ondrej ppa, installed the stock ubuntu php 8.1 fpm with the fix and all the php8.1 equivalents for the php8.0 modules installed by MIAB. Then changed the nginx php-fpm socket to the php8.1 one in /etc/nginx/conf.d/local.conf and replaced the php8.0 paths in /etc/cron* folders and mailinabox’s scripts/files in /root/mailinabox.

Working fine so far, not sure if there’s anything which doesn’t work with php 8.1. (According to some comments in the source, the reason for using php8.0 was nextcloud, but the current nextcloud version in MIAB supports php 8.2 even, I think.)

The upload_progress config change doesn’t fix the whole issue. You need the patched PHP version!

PR Submitted for PPA Migration:
ppa migration for PHP Security Fixes by writeDavid · Pull Request #2609 · mail-in-a-box/mailinabox

1 Like

The old ppa: ondrej/php has released the security fixes, so my PR is now just migrating to the new repository for future php versions

Title: PHP 8.0 security update via Sury on MIAB v75 / Ubuntu 22.04 — please review

I have applied the repository migration discussed above to two MIAB v75 instances running Ubuntu 22.04. I’m sharing the procedure and checks so others can review, confirm, or correct it.

Both servers previously used ppa:ondrej/php with PHP package version:

1:8.0.30-22+ubuntu22.04.1+deb.sury.org+1

The new Sury repository provided:

1:8.0.30-25+0~20261021.88+ubuntu22.04~1.gbpabebea

Its packaged changelog explicitly lists CVE-2026-109618 and CVE-2026-109619 as fixes backported from PHP 8.2.35. PHP itself still reports 8.0.30 , so checking php -v alone does not distinguish the patched package.

Procedure

Before changing anything, back up your configuration and package inventory. I also had a VM snapshot for the first server.

The following commands require Bash and root privileges. The old source filename below matched my installations; check yours first.

backup="/root/php2shell-$(date +%Y%m%d-%H%M%S)"
mkdir -m 700 "$backup"

cp -a /etc/apt/sources.list.d "$backup/"
cp -a /etc/php "$backup/"
dpkg-query -W > "$backup/packages.before.txt"
php8.0 -m > "$backup/modules.before.txt"

# Record the installed PHP packages.
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' 'php*' \
  | awk '$1 == "ii" {print $2}' \
  > "$backup/php-packages.txt"

# Install the repository keyring following Sury's instructions.
curl -fsSL https://packages.sury.org/debsuryorg-archive-keyring.deb \
  -o "$backup/debsuryorg-archive-keyring.deb"

dpkg -i "$backup/debsuryorg-archive-keyring.deb"

# Disable the old PHP PPA, retaining its configuration.
mv /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list \
  "$backup/ondrej-ubuntu-php-jammy.list.disabled"

# Add the new repository for Ubuntu 22.04 (jammy).
printf '%s\n' \
  'deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ jammy main' \
  > /etc/apt/sources.list.d/php.list

apt-get update

# Check the source and full candidate version before proceeding.
apt-cache policy php8.0-fpm php8.0-common

# Simulate the upgrade first and review the proposed changes.
mapfile -t packages < "$backup/php-packages.txt"
apt-get -s --no-remove --only-upgrade install "${packages[@]}"

# If the simulation is satisfactory, perform the upgrade,
# retaining existing configuration files.
apt-get --no-remove --only-upgrade \
  -o Dpkg::Options::=--force-confdef \
  -o Dpkg::Options::=--force-confold \
  install "${packages[@]}"

/usr/sbin/php-fpm8.0 -t
systemctl restart php8.0-fpm

On both servers, this upgraded 21 PHP-related packages without removing packages or changing PHP major/minor versions. I did not modify MIAB’s setup scripts or run a full MIAB setup.

Verification

dpkg-query -W php8.0-fpm php8.0-common php8.0-cli php8.0-opcache

zcat /usr/share/doc/php8.0-common/changelog.Debian.gz \
  | grep -A1 'CVE-2026-109618, CVE-2026-109619'

dpkg --verify php8.0-fpm php8.0-common php8.0-cli php8.0-opcache

systemctl is-active php8.0-fpm nginx mailinabox postfix dovecot nsd

# Compare the running FPM master's executable with the installed file.
pid=$(systemctl show php8.0-fpm -p MainPID --value)
sha256sum /usr/sbin/php-fpm8.0 "/proc/$pid/exe"

Both servers had the expected package revision, both CVEs appeared in the changelog, and the running FPM executable matched the installed binary. I also checked the FPM children and executed a small temporary script through the local FPM socket.

The PHP configuration hashes and CLI module lists were unchanged. Package verification reported only the existing customized FPM www.conf , with no binary differences.

Direct backend checks returned HTTP 200 for Roundcube and the admin UI, and HTTP 401 for unauthenticated ActiveSync. Mail services remained active. These were basic availability checks, not authenticated end-to-end tests. Existing Nextcloud and public reverse-proxy errors were present before the update and remained afterward.

I have not run an exploit test. My conclusion that these packages address both vulnerabilities relies on the maintainer’s changelog and confirmation that the updated runtime is actually running.

Questions for review

  • Is this the intended migration path for existing MIAB v75 installations, consistent with PR #2609?
  • Can the maintainers confirm that this PHP 8.0 package revision contains the complete fixes for both CVEs?
  • Are there additional MIAB-specific compatibility checks or package changes we should perform?

MIAB v75’s setup script still adds the old PPA, so I plan to review the package sources again after future MIAB updates. If MIAB adopts this same Sury repository, there should be no need to switch back; otherwise, any source change should preserve a confirmed patched package version.

if this is the case, wont an apt update; apt upgrade just fix this for now?

Ign:184 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-bcmath amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:185 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-zip amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:186 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-xml amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:187 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-sqlite3 amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:188 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-soap amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:189 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-readline amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:190 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-pspell amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:191 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-opcache amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:192 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-mbstring amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:193 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-intl amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:194 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-imap amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:195 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-gmp amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:196 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-gd amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:197 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-cli amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:198 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-fpm amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:199 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-dev amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:200 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-curl amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:201 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-common amd64 1:8.0.30-24+ubuntu22.04.1+deb.sury.org+1
Ign:202 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.0-apcu amd64 5.1.28-2+ubuntu22.04.1+deb.sury.org+1

I believe so, yes.

Confirming the Sury migration from #17 on MiaB v77 (Ubuntu 22.04), plus a note for anyone running Docker webmail next to MiaB

1. MiaB’s PHP 8.0: the procedure from post #17 works as written on v77

As of this afternoon (UTC), the old ppa:ondrej/php still offered only 1:8.0.30-24 to me, even after apt-get update, so a plain apt upgrade did not fix anything. After switching to packages.sury.org (keyring + deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ jammy main), the candidate became 1:8.0.30-25+0~20261021.88+ubuntu22.04~1.gbpabebea.

  • Simulation first: 20 packages upgraded, 0 removed, 0 new. php8.0-apcu, php8.0-imagick and php-pear were unchanged (same version in both repos) and still load fine.
  • Upgraded with --only-upgrade --no-remove and --force-confold, then php-fpm8.0 -t and systemctl restart php8.0-fpm.
  • Checks:
    • all php8.0-* packages at -25, and zcat /usr/share/doc/php8.0-common/changelog.Debian.gz | grep 'CVE-2026-109618, CVE-2026-109619' matches
    • sha256sum /usr/sbin/php-fpm8.0 /proc/$(systemctl show php8.0-fpm -p MainPID --value)/exe gives identical hashes, and all FPM children run the new binary
    • php8.0 -m is identical before and after
    • /mail/, /admin/ and /cloud/status.php ret01 (expected without auth); postfix, dovecot and nsdare unaffected
  • Reminder: php -v still says 8.0.30. Check the pelog, not the version string. Also, runningmailinabox setup again (e.g. on upgrade) re-adds the old PPA until PR #2609 lands, so check apt-cache policy php8.0-fpm
    afterwards.

2. If you run Roundcube alternatives in Docker (SNOT covered by the above

Each container ships its own PHP. As of today:

  • djmaze/snappymail:latest (also ghcr.io/the-djmaze/snappymail) is from Oct 2024 and has PHP 8.2.24
  • cypht/cypht:2.13.0 and :daily have **PHP 8.3.

So docker compose pull alone won’t help. The offi patched (8.2.35-fpm-alpine, 8.3.36-fpm-bookworm, 8.4.27), so I rebuilt both from their upstream Dockerfiles (SnappyMail tag v2.38.2 from .docker/release/Dockerfile, Cypht tag v2.13.0 from docker/Dockerfile) on top of those

The catch: pecl.php.net returns HTTP 500 today, fails. Workarounds that worked for me:

  • Cypht (old and new image are both Debian bookworm): COPY --from=cypht/cypht:2.13.0 the prebuilt xdebug/redis/gnupg/memcached/ldap .so files + thestall only the runtime libs (libgpgme11libmemcached11 libldap-2.5-0 liblz4-1 libzstd1 libsasl2-2). Same minor version = same extension API (20230831), so they lo- SnappyMail: copy apcu/igbinary/redis/uuid .so f29). But build gnupg (tag gnupg-1.5.4, clone with --recursive) and imagick (tag 3.7.0) from GitHub with phpize, because the newer Alpine has gpgme 2.x (`libgpgme.so.a newer ImageMagick.
  • Verify with php -v and php -m inside the new image (no warnings, same module list as before). Back up the SnappyMail anonymous volume at /var/lib/snappymail, wherthe Cypht DB. Cypht runs its DB migrationsautomatically on start.
    Happy to share the patched Dockerfiles if useful. And the usual disclaimer: I haven’t run an exploit test. This relies on the upstream changelogs and on confirming that the patcually running.
1 Like