#1114729 apache2 delivers .php files uninterpreted in clear during apt dist-upgrade

Package:
apache2
Source:
apache2
Description:
Apache HTTP Server
Submitter:
Philipp Gühring
Date:
2026-07-18 21:01:01 UTC
Severity:
normal
Tags:
#1114729#5
Date:
2025-09-08 22:09:15 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
I have an Debian server with Apache which is serving various PHP applications
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
I start apt dist-upgrade which updated apache2 to a newer version
   * What was the outcome of this action?
During the run of apt dist-upgrade, apache suddenly delivered the .php files uninterpreted in cleartext to the clients, revealing any secrets, database connection strings, passwords, API keys, ... to the user requesting the page.
After apt dist-upgrade was complete, apache correctly interpreted the .php files again
   * What outcome did you expect instead?
I would have expected apache2 to not leak the .php sourcecodes, to either correctly interpret .php files during the migration, or to have apache2 stopped during the migration if that is not possible.

I have sent this report to the Debian Security Team first, and they told me to file a public report instead.

#1114729#10
Date:
2025-09-26 07:03:19 UTC
From:
To:
Dear Philipp,

please tell us how exactly are you running the PHP interpreter in your apache
(mod_php or PHP-FPM or...)?

Also, please include relevant configuration parts from mods-enabled, conf-
enabled, sites-enabled.

Regards,
Moritz

#1114729#17
Date:
2025-12-13 07:54:04 UTC
From:
To:
I've noticed the same with upgrades of systems at $DAYJOB where libapache2-mod-php8.4 did not get enabled automatically after the upgrade of libapache2-mod-php.

The upgrade procedure for those systems added steps to explicitly enable it:

  a2enmod php8.4
  service apache2 restart

Kind Regards,

Bas

#1114729#22
Date:
2026-01-19 14:57:46 UTC
From:
To:
Hi,

Le Sat, Dec 13, 2025 at 08:54:04AM +0100, Sebastiaan Couwenberg a écrit :

Thanks for the feedback. The initial bug report also seem to imply that
the issue happens “During the run of apt dist-upgrade”, i.e., during a
major upgrade. Maybe this issue should rather be documented in the
release notes actually, and it may not be specific to PHP either.

Regards,

taffit

#1114729#27
Date:
2026-07-18 21:00:08 UTC
From:
To:
Hi,

* David Prévot [Mon Jan 19, 2026 at 03:57:46PM +0100]:
the behavior, but wasn't able to do so. This might indeed be
configuration/setup specific?

This feels like a *different* bug report than the original bug
report (the one from Philipp)?

I tried to reproduce also the issue from Sebastiaan, but couldn't -
it seems to be working as expected for the bookworm->trixie upgrade
situation (as long as libapache2-mod-php is/was present on bookworm,
and not only libapache2-mod-php8.2 was explicitly installed, because
then libapache2-mod-php8.4 would be missing on trixie of course).

Situation on bookworm:

  root@f4e23b69b69f:/# ls -la /etc/apache2/mods-enabled/php*
  lrwxrwxrwx 1 root root 29 Jul 18 20:10 /etc/apache2/mods-enabled/php8.2.conf -> ../mods-available/php8.2.conf
  lrwxrwxrwx 1 root root 29 Jul 18 20:10 /etc/apache2/mods-enabled/php8.2.load -> ../mods-available/php8.2.load

After the upgrade to trixie:

  root@1f7465dbdcb4:/# ls -la /etc/apache2/mods-enabled/php*
  lrwxrwxrwx 1 root root 29 Jul 18 20:20 /etc/apache2/mods-enabled/php8.4.conf -> ../mods-available/php8.4.conf
  lrwxrwxrwx 1 root root 29 Jul 18 20:20 /etc/apache2/mods-enabled/php8.4.load -> ../mods-available/php8.4.load

I'm wondering whether any *further* php version might also have been
present (like the ones thankfully being provided at
https://deb.sury.org/) before the upgrade to trixie?

FTR, my STR:

  podman run --pull=always --rm -i -t -v $(pwd)/:/code:rw debian:bookworm bash
    apt update ; apt -y install apache2 libapache2-mod-php
    sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/debian.sources
    apt update
    apt -y dist-upgrade

regards
-mika-