GrepBoard/Manuals
605 manuals ·

Turn off session.upload_progress and confirm it applied

·Tested on Ubuntu 24.04 · php8.3 8.3.6-0ubuntu0.24.04.13 (package unpacked, php-fpm started temporarily on a private socket)·Test scope ↓·5 steps

PHP's 23 Oct advisory recommends session.upload_progress.enabled=0 until the next release. Pin it in the FPM pool and verify it survives an override attempt.

In its informational advisory of 2026-10-23, the PHP project recommends setting session.upload_progress.enabled=0 until the next regular bugfix release, to protect against an unlikely remote code execution vector. The same value was already listed as a mitigation in the 21 Oct CVE-2026-109619 advisory; if you applied it then, leave it as is. The text is in the php.net 2026 news archive.

The conditions the advisory gives are narrow: session.serialize_handler set to php_binary or php_serialize in configuration, an application that switches it to php with ini_set() before session_start(), and upload progress still enabled. The advisory says applications that never change the handler at runtime can keep the feature on. This article predates the full advisory for CVE-2026-115560, so it gives no affected version numbers.

[1] Look at the value. A CLI started with no config files (-n) defaults to on.

console
$ php -n -i | grep upload_progress$ php -n -d session.upload_progress.enabled=0 -i | grep upload_progress.enabled
output
session.upload_progress.cleanup => On => Onsession.upload_progress.enabled => On => Onsession.upload_progress.freq => 1% => 1%session.upload_progress.min_freq => 1 => 1session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESSsession.upload_progress.prefix => upload_progress_ => upload_progress_session.upload_progress.enabled => Off => Off

On a server, php -i without -n reads the CLI php.ini, so its output may differ from the above. The -d in the second command affects only that CLI process; it tells you nothing about the FPM or Apache workers. Step 5 covers those.

[2] Before turning it off, check whether your application uses the feature. The setting records upload progress in the session, so an app that draws a progress bar is affected. That effect was not tested.

[3] Pin it in the FPM pool. A php_admin_value makes a value that neither the application's ini_set() nor a directory's .user.ini changes (the PHP manual says it cannot be overridden by .htaccess or ini_set()). The file below is the pool file in the Ubuntu package's default layout.

/etc/php/8.3/fpm/pool.d/www.conf
php_admin_value[session.upload_progress.enabled] = 0

Apache mod_php uses different syntax: not [name] = value, but one space-separated line in the Apache config (virtual host or global). The manual has an example of the same form, php_admin_flag engine on; this line was not tested.

Apache config
php_admin_value session.upload_progress.enabled 0

After editing, check the syntax first: php-fpm8.3 -t for FPM, apachectl configtest for Apache. Only the FPM check was run.

console
# php-fpm8.3 -t
output
NOTICE: configuration file fpm.conf test is successful

[4] Apply it. Editing the file does not change workers that are already running. In the test, the config of a temporary FPM was edited and the value queried three times.

output
-- before editenabled='1'-- after edit, no reloadenabled='1'-- after USR2enabled='0'

Right after the edit the value stayed '1'; it became '0' only after the master process re-read its config (USR2). The advisory says to restart every worker. systemctl restart php8.3-fpm drops in-flight requests, so do it in a quiet hour and only after the -t above passes. To drop fewer requests, first check with systemctl cat php8.3-fpm whether systemctl reload php8.3-fpm sends that same USR2. A service restart and reload were not done here. The needrestart article shows how to see what still needs a restart.

[5] Ask a real worker through a web request, and see whether the application side can undo the setting. Put a temporary file in the web root, request it once, and delete it immediately. Do not leave a full phpinfo() page behind.

php
<?phpecho "enabled=", var_export(ini_get('session.upload_progress.enabled'), true), "\n";

This setting is of a kind that ini_set() can never change, so ini_set() returns false even when the pool has no setting. Its result is not evidence of pinning.

output
$ php-fpm pool without the setting: ini_set("session.upload_progress.enabled", "0")ini_set=falseenabled='1'

The evidence is an attempt to override it from a directory's .user.ini. In the test, each case had its own directory with a .user.ini, the pool setting varied, and the same file was requested (the request must carry DOCUMENT_ROOT for .user.ini to be read).

output
# a: no pool setting, no .user.inienabled='1'# b: no pool setting, .user.ini sets 0enabled='0'# c: pool php_admin_value 0, .user.ini sets 1enabled='0'# d: pool php_value 0, .user.ini sets 1enabled='1'

Case b shows that .user.ini can change this value. In c, the pool's php_admin_value blocked the 1 from .user.ini; in d, a value set with php_value was overridden by it. Put the value in the pool with php_admin_value, never php_value.

Where checks go wrong

  • ini_set() returning false does not mean the value is pinned. It was false on an FPM with no pool setting too.
  • A php_value in the pool is undone by .user.ini (case d above).
  • The CLI's php -i value and the web worker's value differ. Ask the worker directly, as in step 5.
  • Without a restart or reload, the value does not change (the step 4 output).

#php#php-fpm#session#hardening