github slackero/phpwcms v2.0.0-beta.6
phpwcms v2.0.0-beta.6

latest releases: v2.0.0-beta.7, v1.9.55, v1.12.9...
pre-release51 minutes ago

Sixth beta of the phpwcms 2.x line. This is a hardening release: most changes close access-control, traversal and information-disclosure gaps found in the backend, the frontend image and form paths and the shipped web server configuration.

⚠️ Upgrade notes

  • Private storage moved out of the document root. tmp, cache, log, backup and form now live in $phpwcms['storage_path'] (default ../phpwcms-storage, mode 0700). Revision r565 moves existing data and leaves a deny file where a directory could not be moved completely. Check the update output and the backend Security Check afterwards.
  • Form uploads are private. Stored files are served only through the signed controller formfile.php?t=<token>. Links in mail sent before this update point at content/form/ and no longer resolve.
  • Backend sessions get a new cookie name derived from database name and table prefix. Every backend user has to log in once more after the update.
  • Article ownership is enforced on backend writes; non-admins can only save their own articles. Use the new artall usergroup (revision r567) for shared editing, or set $phpwcms['article_ownership'] = 0 to restore the previous behaviour.
  • Backups are no longer downloadable through setup/upgrade.php?download=; retrieve them over FTP/SSH.

🔒 Security

  • Random image archive visibility and path traversal: img/random_image.php served any image below the private archive and joined the unauthenticated imgdir parameter to the root with a single ../ strip. Directory access is now resolved through phpwcms_image_dir_path() and limited to the root, and archive files follow the same public, active, non-trashed and f_granted=0 rule as _getFileInfo().
  • Frontend image grant check: img/cmsimage.php filtered only f_public, so images restricted to logged-in frontend users were served anonymously.
  • Glossary template traversal: a stored glossary_template such as ../../../../index.php was read with file_get_contents(). The name is now resolved through phpwcms_template_file_path(), which rejects absolute paths, stream wrappers, traversal and symlink escapes.
  • Password reminder tokens: Content Part 28 replaced the account password during an anonymous reminder request and mailed the new value. It now issues a single-use token (stored as SHA-256 hash, one-hour expiry, older tokens dropped, rate limited per IP) and changes the password only after the token is submitted with a new one. Shipped templates use {RESET_URL}.
  • Ajax toggle authorization: ajax_changer.php toggled any column of any row for every backend user, including usr_admin. Toggles are limited to a whitelist of list columns and follow the owner or permission rule of the screen that renders them.
  • Form export authorization: the non-API branch of act_export.php did not check the requested form, so any backend user could export the submissions and source IPs of any form.
  • Content Part 21 local file read: the manual page address accepted file:// and other local stream wrappers. Only http and https are accepted now, when saving and in include_url().
  • Private file tooltip XSS: the file name and copyright were HTML-encoded but injected into a single-quoted inline Tip() call, so an apostrophe ended the string and executed markup in an administrator session. Both values are escaped with js_inline_string().
  • phpinfo exposure: do=admin&p=15 rendered the phpinfo page without a permission check. It requires usr_admin = 1 now.
  • Article ownership: article, content part, visibility, type-change, move and insert actions updated by id without an owner clause, so a non-admin could publish or edit another user's article. All backend article and content part writes require ownership for non-admins now.
  • Default-deny web server configuration: .htaccess, _.htaccess, nginx.conf and web.config deny the private content directories, internal include/ paths, upload/, tests/, hidden files and sensitive extensions, and serve only an explicit public allowlist.

✨ Added

  • Backend Security Check (p=20): scans the private storage tree, legacy content/ directories, per-directory protectors and the root server configuration, and repairs the safe subset without deleting user data. The updater skips content/, upload/, filearchive/, include/config/ and setup/, so protectors there are never refreshed by an update.

🐛 Fixed

  • Concurrent backend sessions: installations on one host shared the default PHPSESSID cookie, so neighbouring backends replaced each other's session. The cookie name is derived from database name and table prefix now, with HttpOnly, SameSite=Lax, an installation-scoped path and Secure behind HTTPS.

🛠️ Changed

  • Backend navigation: page layout, templates, template translations and custom content parts moved into a dedicated Design section. System Update, Security Check, phpinfo, flush image cache and move deleted files moved into a superadmin-only System section.
  • Updater paths: the update engine and setup/upgrade.php keep backups and temporary files below <storage_path>, create them with 0700/0600, and accept a storage_path override in the upgrade form. The unused content/less/ directory is removed.

Database revision moves to r567. Requires PHP 8.4+.

Security advisories

Each fixed issue has a published GitHub security advisory:

Don't miss a new phpwcms release

NewReleases is sending notifications on new releases.