Skip to content

feat: php-cve-mitigation.sh — session.upload_progress Off on every PHP install - #37

Open
khoipro wants to merge 1 commit into
mainfrom
feat/php-cve-mitigation
Open

khoipro wants to merge 1 commit into
mainfrom
feat/php-cve-mitigation

Conversation

@khoipro

@khoipro khoipro commented Oct 21, 2026

Copy link
Copy Markdown
Member

Context

php.net scheduled a security release for 2026-10-21 14:00 UTC fixing two critical PHP core vulnerabilities (both CVSS v4.0 9.2). Third-party research (Sansec "php2shell", watchTowr) ties them to CVE-2026-109618 / 109619 and a session.upload_progress trigger path — not yet confirmed by PHP. Turning session.upload_progress.enabled Off removes that reported path while PHP builds are updated. Not a fix.

What this adds

php-cve-mitigation.sh (same script as codetot/ec2-bash-scripts#17), which finds every PHP install without a version list:

Layout php.ini Reload
RunCloud Nginx /etc/phpXXrc/php.ini (+ the file the binary reports) phpXXrc-fpm (after php-fpm -t)
OpenLiteSpeed asked from /usr/local/lsws/lsphpXX/bin/lsphp -i lswsctrl restart (unit lsws-rc) + stop detached lsphp workers
Ubuntu / Ondrej /etc/php/<X.Y>/*/php.ini phpX.Y-fpm, apache2
  • Patches conf.d files that turn the setting On; reports per-app fpm.d pool values and .user.ini / .htaccess under /home/*/webapps.
  • --audit, --dry-run, --rollback (newest *.bak-pre-cve-<UTC stamp> per file).
  • Exits 1 and lists services where the change is not live (configtest or reload failed).
  • tests/php-cve-mitigation.test.sh — 25 function checks on fake ini files.
  • README section + feature line, CHANGELOG v0.0.3.0, VERSION 0.0.3.0.

Note: uses the ec2 repo's log/pass/warn/fail helpers rather than this repo's info/success/warn/error, to keep one identical script in both repos.

Test plan

  • bash -n, shellcheck clean; tests 25/25
  • --audit then --dry-run on one Nginx and one OpenLiteSpeed server
  • apply + --rollback on a staging server, check sites and uploads
  • fleet rollout via the usual git pull deploy; optional dashboard action in runcloud-go
  • after the PHP release: update PHP from RunCloud and re-run --audit

…n every PHP install

Covers RunCloud phpXXrc (Nginx), OpenLiteSpeed lsphpXX (lsws-rc) and Ubuntu/Ondrej /etc/php, found by globbing and by asking each PHP binary for its loaded php.ini. Patches conf.d overrides, reports fpm.d / .user.ini / .htaccess values. --audit, --dry-run, --rollback; php-fpm -t before reload; exits 1 when a service could not be reloaded. Defence in depth for the October 2026 PHP core advisory, not a fix. Same script as codetot/ec2-bash-scripts#17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant