Skip to content

phpwcms v1.9.55

Choose a tag to compare

@slackero slackero released this 25 Nov 20:53
· 270 commits to master since this release
ae3b729

Security release for the phpwcms 1.9 legacy line (PHP 7.4). It backports the access-control, traversal and information-disclosure fixes from the 1.12 line.

🔒 Security

  • 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}.
  • 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 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 resolved through phpwcms_template_file_path(), which rejects absolute paths, stream wrappers, traversal and symlink escapes.
  • 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().
  • Article visibility ownership: act_articlecontent.php case 3 changed article_aktiv by article id without an owner check, so a non-admin could publish another user's article.
  • Form export authorization and key comparison: the non-API export branch did not check the requested form, and the direct-download key was matched through an unescaped SQL LIKE pattern, so wildcards matched any stored key. The form must belong to an article the user owns, and the key is validated as alphanumeric and compared with hash_equals().
  • 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().
  • Upload executable extensions: the backend upload paths and the FTP takeover accepted server-executed extensions. One shared extension list checks every dot-separated segment, and the takeover checks the file before it becomes executable in the web-served storage.
  • Web server default-deny: Apache, nginx and IIS deny HTTP access to content/{tmp,cache,log,backup}, include/config, include/vendor, upload/, filearchive/ and tests/. nginx and IIS use an explicit allowlist now, so renaming a private directory no longer exposes it, and PHP execution is blocked inside private and upload directories.

🐛 Fixed

  • Multibyte alias truncation: proof_alias is cut with mb_substr() now, so a UTF-8 sequence is not split.
  • Setup HTML escaping: the manual setup escaper no longer double-encodes named and hex entities, and substitutes invalid UTF-8 like the core wrapper.

🛠️ Changed

  • jQuery 3.8: the frontend library set gains jQuery 3.8 (Migrate 3.6.0) and 4.1 (Migrate 4.0.2) in plain, migrate and slim variants. Existing versions stay selectable.

No new database revision; the revision stays at r564. Requires PHP 7.4+.

If you run nginx or IIS, review the updated nginx.conf/web.config: they now serve only an explicit allowlist of public paths.

Security advisories

Each fixed issue has a published GitHub security advisory: