Critical PHP Security Release

Note: This page will be updated with additional guidance throughout the day as extra details & patches become available.

BookStack runs on PHP.
The PHP project has announced an upcoming critical security release.

There are reports that the details of the bugs have been found/leaked before the disclosure time, allowing remote code execution on affected systems.

If you run a BookStack instance on the open web, or in any environment where it could be accessed by potential attackers or untrusted users, it may be best to take the instance offline (turn off the server, disable web traffic etc…) until patches are made available and applied in your hosting environment.

Remedies

As of 13:50 UTC, details have been published on the PHP website.

Fixes are included as part of the following versions of PHP:

  • PHP 8.5.12
  • PHP 8.4.27
  • PHP 8.3.36
  • PHP 8.2.35

Note: Some environments will ‘backport’ (re-apply) fixes to older versions, so fixed versions may confusingly show old version numbers.

We will monitor how these are rolled out and applied to common environments below.

Common BookStack Environments

  • ๐ŸŸ  Ubuntu (Installed with our install scripts)
    • ๐ŸŸข Fixed official PHP packages available for LTS 22.04, 24.04 and 26.04.
      • โš ๏ธ Backports are applied to Ubuntu, so version numbers may not reflect the ‘fixed’ versions. See below.
    • ๐ŸŸ  PHP packages provided by the deb sury (ondrej/php) repo are slowly rolling out
      • These are often used for getting later/earlier PHP versions. You might be using these packages if you’ve upgraded the PHP version without upgrading your operating system.
  • ๐Ÿ”ด Docker: LinuxServer Image - Awaiting Fix, they are aware, currently working on it ๐Ÿ‘ท
  • ๐ŸŸข Docker: solidnerd Image
  • ๐Ÿ”ด Home Assistant: BookStack Community App - Awaiting Fix
  • ๐ŸŸ  Debian - Fixed versions available
    • โ„น๏ธ These come from the Debian security repository. If you are not receiving the new versions ensure that you have the Debian security repository enabled.
      • ๐ŸŸข PHP 8.4.27 is available in official Debian Trixie package repositories.
      • ๐ŸŸข PHP 8.2.35 is available in official Debian Bookworm package repositories.
    • ๐ŸŸ  PHP packages provided by the deb sury (ondrej/php) repo are slowly rolling out
      • These are often used for getting later/earlier PHP versions. You might be using these packages if you’ve upgraded the PHP version without upgrading your operating system.
  • ๐Ÿ”ด RHEL/Rocky/Alma Linux - Awaiting Fix
    • โš ๏ธ rpms.remirepo.net will not receive updates today. It’s advised that you move to distro packages (when made available) or build from source. Otherwise, it’s best to keep these environments offline for now.
  • ๐ŸŸ  Arch AUR Package
    • ๐ŸŸข Dependent Arch PHP package updated, so updating packages should get the fixed PHP version.
    • โš ๏ธ The version of BookStack in the AUR is outdated and is lacking BookStack security release patches.

Applying Updates

Here’s some guidance for updating to use fixed PHP versions in common BookStack environments:

For Ubuntu installs (following our scripts) and Debian

To update to patched versions of PHP you should simply update the system packages like normal:

1
2
sudo apt update
sudo apt upgrade

Those commands may restart the webserver/php processes themselves, but you can be sure by restarting them yourself:

1
sudo systemctl restart apache2.service 'php8*.service'
Docker: solidnerd Image

To update to a fixed version of the solidnerd docker image, re-pull and use the latest container images for the 26.9.2, 26.9, or latest tags. (Note: Old unfixed versions also used these tags. You can’t rely on the image tag alone).

Then re-create your BookStack container. If using docker compose, this is usually done via taking the stack down, then bringing it up again.

To validate your running instance is using a patched version of PHP, you can run php -v via the container, to ensure the response shows 8.5.12:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Find the BookStack container ID by running:
docker ps

# Check the PHP version inside the container
docker exec container_id php -v

# Example output:
# PHP 8.5.12 (cli) (built: Oct 21 2026 15:49:40) (NTS)
# Copyright (c) The PHP Group
# Built by https://github.com/docker-library/php
# Zend Engine v4.5.12, Copyright (c) Zend Technologies
#     with Zend OPcache v8.5.12, Copyright (c), by Zend Technologies

Validating PHP Version

In many environments, you can simply run php -v to check the version of PHP installed but this won’t ensure that’s the version being used for serving BookStack. Sometimes there can be multiple versions of PHP in use, or the web server could be using an outdated version.

Ideally, you’d check the version via the web-server.

For a Ubuntu install (following our scripts)

Ubuntu has patched this via backports, which makes it not possible to check for fixes based on version number as per the option below.

Instead, we’ll check for a specific PHP package to check the version by running:

1
apt list --installed 'php8.*-curl' 2>/dev/null

This should output something like:

1
2
Listing... Done
php8.3-curl/noble-security,now 8.3.6-0ubuntu0.24.04.13 amd64 [installed,automatic]

In this example, 8.3.6 is the PHP version and 8.3.6-0ubuntu0.24.04.13 is the full version string. Here’s how to confirm a fixed version of PHP:

  • PHP version starts with 8.5?
    • Full version exactly matches 8.5.4-0ubuntu1.5? Fixed
    • Version equal to or greater than 8.5.12? Fixed
    • Otherwise, not fixed.
  • PHP version starts with 8.4?
    • Version equal to or greater than 8.4.27? Fixed
    • Otherwise, not fixed.
  • PHP version starts with 8.3?
    • Full version exactly matches 8.3.6-0ubuntu0.24.04.13? Fixed
    • Version equal to or greater than 8.3.36? Fixed
    • Otherwise, not fixed.
  • PHP version starts with 8.1?
    • Full version exactly matches 8.1.2-1ubuntu2.28? Fixed
    • Otherwise, not fixed.

When comparing versions, in each of the above ’equal to or greater than’ checks, you are looking specifically at the third part of the number (e.g. 27 in the version 8.4.27).

If you see multiple versions, you may want to uninstall PHP versions not in use to avoid confusion as to what’s being used. You may also want to restart your server, or at least the webserver, to ensure any updated version is in use:

1
sudo systemctl restart apache2.service 'php8*.service'
For a standard on-system (non docker) install - without backports (Debian, Arch)

You could check the PHP version by running the below command to place a version check script in the BookStack served files:

NOTE: This command assumes a /var/www/bookstack installation directory, which is the default when using our scripts.

1
echo '<?php $m=["8.2"=>"8.2.35","8.3"=>"8.3.36","8.4"=>"8.4.27","8.5"=>"8.5.12"];$v=PHP_VERSION;$p=explode(".",$v);$l=$p[0].".".$p[1];echo $v." ".(isset($m[$l])&&version_compare($v,$m[$l],">=")?"PASS":"FAIL").PHP_EOL;' | sudo tee /var/www/bookstack/public/check.php

With this set, in the browser visit <your_bookstack_instance_url>/check.php. You’ll see your PHP version number in use followed by ‘PASS’ if using a patched PHP version, or ‘FAIL’ if using a vulnerable version.

After checking, remove the created script: sudo rm /var/www/bookstack/public/check.php.

If the version shown differs from what’s seen when running php -v, ensure you’ve since restarted your webserver, and any PHP related services:

1
sudo systemctl restart apache2.service 'php8*.service'

Workarounds

If you are not able to patch your systems, the PHP project has published some measures in their blog post to reduce exposure to specific attack surfaces, mostly by changing PHP configuration. They advise these don’t make an installation safe though, and that patching is the primary solution.

Issue & Patch Tracking

These issues are assigned the following IDs:

The PHP project has posted details on the PHP website.

Further Help

Feel free to ask for help in the BookStack community forum. I’ll be monitoring for new posts more frequently over the next day to provide support.

If you’d like to be notified of future BookStack related security concerns, you may want to consider signing up to the BookStack security mailing list.

Supporting the PHP Ecosystem

The folks working on PHP are doing a great job. Handling scenarios like this can be extremely hard, and it requires a lot of work and mental effort from the maintainers of PHP and its supporting distribution.

Where able and willing, here are some good options for financially supporting the PHP ecosystem:


Header Image Credits: Photo by Giles Laurent (cc-by-sa-4) - Image Modified