
Bash utility that audits PHP INI, FPM pool and site configs for session.upload_progress.enabled and applies the CVE-2026-115560 mitigation with backups and rollback.
A standalone Bash utility for finding PHP configurations and applying the temporary mitigation recommended by the PHP project:
session.upload_progress.enabled = 0
Status (2026-10-24): temporary mitigation, not a PHP security patch. On 2026-10-23, the PHP project advised disabling PHP session upload progress until the next regular bugfix release to address an unlikely RCE scenario. The affected application setup involves session.serialize_handler set to php_binary / php_serialize in configuration, then changed to php at runtime before session_start(), while upload progress remains enabled. Applications that do not change the session serializer at runtime are not exposed to this particular scenario according to the PHP notice. This utility applies a conservative configuration-level workaround; it does not attempt exploitation or vulnerability scanning.
Review the script before running it as root:
git clone https://github.com/ivst/CVE-2026-115560.git
cd CVE-2026-115560
bash -n php-upload-progress-mitigate.sh
sudo bash php-upload-progress-mitigate.sh --check
sudo bash php-upload-progress-mitigate.sh --apply
# Read the changes; reload validated managed PHP-FPM / Apache services:
sudo bash php-upload-progress-mitigate.sh --apply --reload
sudo bash php-upload-progress-mitigate.sh --check
# Optional: inspect running Docker PHP-FPM configurations as well (read-only):
sudo bash php-upload-progress-mitigate.sh --check --check-docker
To validate and gracefully reload discovered PHP-FPM and Apache systemd services as part of applying mitigation:
sudo bash php-upload-progress-mitigate.sh --apply --reload
The script identifies managed PHP-FPM masters via their running PIDs and systemd MainPID, reads the configuration path from the master process, runs the matching FPM binary with -t -y <config>, then uses systemctl reload only if CanReload=yes. Apache receives a config test before its graceful reload. The helper will not automatically signal unknown FPM masters, unverified configurations, or services that lack reload support; it prints warnings and exits with status 2 when manual review is required.
An explicit hard restart remains possible with --apply --restart, but this is not recommended for production sites unless needed:
sudo bash php-upload-progress-mitigate.sh --apply --restart
Warning: Even graceful reloads can cause short-lived errors or terminate some long-running requests. Changes to files are not automatically applied to running workers unless they reload or restart. This utility cannot guarantee complete coverage of containers or panel-managed processes outside the discovered PHP layouts. Prefer a maintenance window and confirm live web-SAPI settings.
php-upload-progress-mitigate.sh [--check|--apply] [--reload|--restart] [--check-docker] [--root=/offline/root] [--site-root=/path]
php-upload-progress-mitigate.sh --rollback=/absolute/backup/directory [--apply] [--root=/offline/root]
| Flag | Purpose |
|---|---|
--check | Default. Static inspection only; does not modify files. |
--check-docker | Optional with live-host --check: use Docker CLI to inspect PHP-FPM and PHP built-in web servers in running Docker containers. No changes or restarts. |
--apply | Write mitigations with backups. Requires root. |
--reload | With --apply, validate and gracefully reload managed PHP-FPM/Apache systemd services; unsupported/unverified services are skipped with warnings. |
--restart | With --apply, validate and hard-restart eligible managed services. Use only when a hard restart is intended. |
--root=/path | Inspect/apply against an offline filesystem tree; never restart services in this mode. Intended for testing/offline maintenance. |
--site-root=/path | Add a site directory to the read-only override scan; repeat for multiple directories. With --root, this is a path inside the offline tree (e.g. /srv/apps). |
--rollback=/path | Preview restoration of one backup directory. Add --apply to restore backed-up files and remove files created by that run. Cannot be combined with service actions, Docker or site scans. |
Exit codes: 0 for no detected warnings, 1 for a fatal/usage error, and 2 when manual review is needed. An --apply run may write mitigation files and return 2 if it encounters additional unhandled warnings.
The script scans common layouts used by Debian/Ubuntu, RHEL-family systems, Remi, standard PHP installation paths, and common hosting panels, including FASTPANEL's internal application runtime (/opt/fphp/php.ini, /opt/fphp/conf.d, /opt/fphp/etc/php-fpm.d). For detected INI trees it writes a late-loading zzzzzz-cve-2026-115560.ini override, or edits php.ini when no scan directory exists. It also detects SAPI-specific replacements such as php-cli.ini (which PHP can load instead of php.ini) and checks sibling scan directories such as /opt/php85/conf.d used by panel-managed installations. It also inserts php_admin_value[session.upload_progress.enabled] = 0 in detected PHP-FPM pool sections to prevent later per-directory overrides of this setting in those pools.
Backups of modified files and a change manifest are stored under:
/var/backups/php-upload-progress/<UTC timestamp>-<PID>/
Only changed existing files are backed up. Backups may contain secrets from PHP-FPM configuration and are created under a restrictive parent directory; keep them private. Each original file is backed up once per run, even if it is updated more than once. New snapshots use versioned v2 records in state.tsv with SHA-256 hashes of the original and applied contents plus the applied target device/inode, UID/GID, mode, size, modification time and change time. Access time is excluded so reading a target does not invalidate it.
To roll back, use the exact backup directory printed by --apply:
sudo bash php-upload-progress-mitigate.sh --rollback=/var/backups/php-upload-progress/TIMESTAMP-PID
sudo bash php-upload-progress-mitigate.sh --rollback=/var/backups/php-upload-progress/TIMESTAMP-PID --apply
The first command only previews the plan. Rollback validates the complete plan before changing files, pins and locks parent directories and file inodes, then rechecks target content, identity and metadata immediately before each restore/removal. Restores use the pinned directories, so replacing an ancestor cannot redirect a write. It refuses edited or missing targets, symlinks, paths outside the selected root, busy locks, and incomplete snapshots. Targets, backups and their ancestors must be owned by root and must not be writable by group/others; root-owned sticky directories such as /tmp are allowed. Resolve conflicts manually; there is no force option. Linux /proc and flock (util-linux) are required for rollback, and flock is required for apply. Apply/rollback writers for the same selected root are serialized. Locks are advisory: pause external configuration editors and configuration management during rollback; an uncooperative writer is not covered by an atomic compare-and-swap guarantee. Rollback retains the backup directory, does not restart services, and is not transactional: an I/O failure or a conflict found during restoration can leave earlier targets restored. Validate configuration and reload affected workers afterwards. Reverting protection can re-enable upload progress. Older snapshots without state.tsv or with hash-only state records require manual restoration from changes.tsv. Replacing a target with identical bytes, changing its owner/group/mode, or editing and then reverting it still invalidates automatic rollback; copied filesystem trees may also have different inode identities.