Skip to content

v5.2.1

Latest

Choose a tag to compare

@jaydrogers jaydrogers released this 20 Nov 17:49
Immutable release. Only release title and notes can be modified.
ec58b57

🔐 Security update: open redirect in fpm-nginx and frankenphp

Important

Pull and redeploy if you use fpm-nginx or frankenphp. A link like https://your-site.com/index.php/%5Cevil.example sent visitors to another site (GHSA-3634-2fr7-xpw4). Thanks to @anatoly-pashin-axon21 for reporting it.

Images take about an hour to publish after this release. When your image's -v5.2.1 tag pulls (like 8.5-fpm-nginx-v5.2.1), the fix is live.

Note

cli, fpm, and fpm-apache are not affected. This release also brings back mbstring on PHP 8.6 and adds static asset caching to fpm-apache.


The /index.php/... redirect stays on your site

v5.0.0 added a redirect from /index.php/<path> to /<path>, so search engines index one copy of each page (#646). The path went into the Location header without a check. Browsers read /\evil.example, or a slash and a tab followed by /evil.example, as //evil.example, which is another host. Attackers could use your domain in phishing links, or to get past OAuth checks that allow any path on your site.

The redirect now skips paths that start with /, \, or whitespace, or that contain a control character. Those requests reach PHP the same way they did before v5.0.0. Normal redirects like /index.php/shop to /shop work as before.

Check your site with:

curl -sI 'https://your-site.com/index.php/%5Cexample.com' | grep -i '^location'

Location: /\example.com means you're affected until you update.

Two other fixes to the same redirect

  • Only GET and HEAD requests redirect now, on every web server variation. A POST to /index.php/webhook used to get a 301, and most clients retried it as a GET without the body. Webhooks registered with the /index.php/ prefix work again.
  • On frankenphp, the redirect kept the path but dropped the query string. /index.php/shop?page=2 now goes to /shop?page=2, like it does on fpm-nginx and fpm-apache.

🐘 mbstring is back on PHP 8.6 (#754)

docker-library/php stopped compiling mbstring in 8.6 (docker-library/php#1654), so the 8.6 images in v5.2.0 shipped without it. Laravel, PHPUnit, and Pint need it. It's now a default extension in every variation. On 8.5 and earlier nothing changes, because PHP already has it built in.

⚡ fpm-apache caches static assets (#754)

fpm-apache was the only variation that sent no cache headers for static files. It now matches fpm-nginx:

  • Cache-Control: public, max-age=31536000, immutable for CSS, JS, images, media, and fonts
  • Access-Control-Allow-Origin: * for fonts

The headers are only added when the response doesn't already have one, so your .htaccess rules still win. mod_expires is now enabled, so <IfModule mod_expires.c> blocks in .htaccess, like the ones WordPress caching plugins add, take effect.

Gzipped files also revalidate properly now (#735). Apache's -gzip ETag never matched, so browsers downloaded those files in full every time. They now get a 304.

If you edit CSS on a volume mount without changing its file name or ?ver=, you'll need a hard refresh to see it. fpm-nginx already works this way.

Thanks to @twiesing for contributing this (#734).

⬆️ How to update

If you use Example Do this
A floating tag 8.5-fpm-nginx Pull and redeploy
A release tag 8.5-fpm-nginx-v5.2.0 Change it to 8.5-fpm-nginx-v5.2.1
A patch version tag 8.5.13-fpm-nginx Pull and redeploy

If you build your own image FROM serversideup/php, rebuild with --pull so Docker doesn't reuse the old base image:

docker compose build --pull

v4 does not have this redirect, so it isn't affected.

If you're using these images professionally

If these images help your business, sponsoring us on GitHub is the best way to say thanks. 🙏

Full Changelog: v5.2.0...v5.2.1