Repository navigation
phpwcms v2.0.0-beta.6
Pre-release
Pre-release
·
153 commits
to master
since this release
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,backupandformnow live in$phpwcms['storage_path'](default../phpwcms-storage, mode0700). Revisionr565moves 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 atcontent/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
artallusergroup (revisionr567) for shared editing, or set$phpwcms['article_ownership'] = 0to 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.phpserved any image below the private archive and joined the unauthenticatedimgdirparameter to the root with a single../strip. Directory access is now resolved throughphpwcms_image_dir_path()and limited to the root, and archive files follow the same public, active, non-trashed andf_granted=0rule as_getFileInfo(). - Frontend image grant check:
img/cmsimage.phpfiltered onlyf_public, so images restricted to logged-in frontend users were served anonymously. - Glossary template traversal: a stored
glossary_templatesuch as../../../../index.phpwas read withfile_get_contents(). The name is now resolved throughphpwcms_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.phptoggled any column of any row for every backend user, includingusr_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.phpdid 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. Onlyhttpandhttpsare accepted now, when saving and ininclude_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 withjs_inline_string(). - phpinfo exposure:
do=admin&p=15rendered the phpinfo page without a permission check. It requiresusr_admin = 1now. - 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.confandweb.configdeny the private content directories, internalinclude/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, legacycontent/directories, per-directory protectors and the root server configuration, and repairs the safe subset without deleting user data. The updater skipscontent/,upload/,filearchive/,include/config/andsetup/, so protectors there are never refreshed by an update.
🐛 Fixed
- Concurrent backend sessions: installations on one host shared the default
PHPSESSIDcookie, so neighbouring backends replaced each other's session. The cookie name is derived from database name and table prefix now, withHttpOnly,SameSite=Lax, an installation-scoped path andSecurebehind 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.phpkeep backups and temporary files below<storage_path>, create them with0700/0600, and accept astorage_pathoverride in the upgrade form. The unusedcontent/less/directory is removed.
Database revision moves to r567. Requires PHP 8.4+.
Security advisories
Each fixed issue has a published GitHub security advisory:
- GHSA-cx22-h9mj-x432 — img/random_image.php: unrestricted access to caller-selected archive images
- GHSA-vf78-4qc9-mgj8 — img/random_image.php: path traversal reads images outside the application root
- GHSA-9wxr-jcrj-j6vc — img/cmsimage.php: missing frontend grant check exposes restricted images
- GHSA-j52f-5994-j8mx — Glossary template traversal permits local-file disclosure
- GHSA-f5cw-xh8w-pvjj — Timestamp-seeded Content Part 28 password reset enables account takeover
- GHSA-vv25-3jh4-fw2p — Private file listing XSS via copyright metadata
- GHSA-555f-prgg-6g47 — Backend article status toggle permits cross-owner publication
- GHSA-p953-wpxf-h7c6 — Missing per-form authorization in the backend form-results export
- GHSA-28j7-mvfw-35pw — Authenticated local file disclosure through Content Part 21
- GHSA-f3vf-5639-qg4p — Anonymous form upload stores scriptable HTML on the application origin