You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release includes major security enhancements, addressing all remaining vulnerability findings from the recent penetration test report.
* Security: Implement global CSRF protection for all AJAX requests via `ci4ms.js` prefilter and clear `csrfExcept` arrays.
* Security: Hide PHP version disclosure by actively removing the `X-Powered-By` header.
* Security: Enforce `cookie.secure = true` for session protection against MitM attacks.
* Security: Replace plaintext passwords in DevGate configuration with Bcrypt hashes.
* Security: Eliminate raw `$_SERVER` superglobal reads across core classes, replacing them with CI4 native helpers (BULGU-10).
* Security: Implement strict file extension blacklisting (.php, .phtml, etc.) and boundary validation in Fileeditor to prevent RCE.
* Security: Restrict DbBackup SQL restore with a strict statement whitelist to prevent malicious database manipulation.
* Security: Upgrade HTMLPurifier to block base64 image data URIs and filter dangerous CSS properties.
* Docs: Update CHANGELOG.md, README.md, and developer handbook with the new Security Architecture specifications.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) conventions adapted to the existing four-component version numbers.
6
6
7
+
## [0.31.9.0] - 2026-05-01
8
+
9
+
### Security
10
+
11
+
-**CSRF Architecture Overhaul:** Implemented centralized `ajaxPrefilter` in `ci4ms.js` for automatic CSRF token injection on all AJAX requests. elFinder route exempted from CSRF via `MediaConfig::$csrfExcept` to prevent stale-token 403 errors during multi-request operations.
12
+
-**HTMLPurifier Hardening:** Removed `data:` URI scheme from `AllowedSchemes` to block `data:text/html;base64` XSS bypass attacks (Base64 images use a custom placeholder mechanism). Disabled `CSS.Trusted` to filter dangerous CSS properties. Enabled `HTML.TargetBlank` for automatic `rel="noopener noreferrer"` on external links. Ensured Blog and Pages controllers always persist `CustomRules::getClean()` sanitized content to the database.
13
+
-**IP Spoofing Fix:** Removed raw `$_SERVER['HTTP_X_FORWARDED_FOR']` and `$_SERVER['HTTP_CLIENT_IP']` reads from `BackendLogFilter`. Now relies solely on CI4's `$request->getIPAddress()` which respects `App.proxyIPs` config for trusted proxy detection.
14
+
-**Raw `$_SERVER` Elimination:** Replaced all raw `$_SERVER['HTTP_HOST']`, `$_SERVER['HTTPS']`, and `$_SERVER['SERVER_NAME']` reads with CI4's `base_url()`, `site_url()`, and `parse_url()` helpers across `Email.php`, `Ci4ms.php`, `Install.php`, and `Settings.php`.
15
+
-**Fileeditor RCE Prevention:** Added `$dangerousExtensions` blacklist (`.php`, `.phtml`, `.phar`, `.htaccess`, etc.) to block creating, writing, or renaming executable files via the file editor. Added `file_exists()` overwrite protection for `createFile` and `realpath` boundary validation for `renameFile`.
16
+
-**SQL Restore Hardening:** Implemented a SQL statement whitelist (`INSERT`, `CREATE TABLE`, `DROP TABLE`, etc.) and dangerous command blacklist (`LOAD_FILE`, `INTO OUTFILE`, `GRANT`, `xp_cmdshell`, etc.) in `DbBackup::restore()`. Added path traversal protection requiring backup files to reside within `WRITEPATH`.
17
+
-**Hardcoded Credentials:** Removed plaintext passwords from `DevGate` configuration. Implemented `bcrypt` hashed passwords and enabled `$useHashedPasswords` by default to protect developer credentials.
18
+
19
+
### Changed
20
+
21
+
-**DevGate CLI Sync:**`php spark ci4ms:setup` now automatically updates `DevGate.php` with the admin credentials provided during installation, matching the web installer's behaviour.
22
+
-**Proxy Configuration:** Added comprehensive Cloudflare and Nginx reverse proxy configuration examples as comments in `App.php::$proxyIPs`.
23
+
-**URI Schemes:** Removed unused `nntp` and `news` URI schemes from HTMLPurifier configuration.
24
+
7
25
## [0.31.8.0] - 2026-04-19
8
26
9
27
### Fixed
@@ -293,6 +311,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
293
311
294
312
- Expanded database migrations and introduced new supporting libraries.
@@ -22,6 +22,7 @@ CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, mo
22
22
-**Flexible content management:** Page and blog entries include SEO metadata, categories, tags, and full comment workflows.
23
23
-**Media & files:** Includes elFinder-powered media management, a built-in file editor, and an in-panel log viewer.
24
24
-**Automatic Updates:** Modernized `UpdateService` provides a "One-Click Update" system with atomic file operations, automated GitHub version discovery (bypassing 300-file limits), and secure rollback management.
25
+
-**Security Architecture:** Global CSRF protection across all AJAX endpoints, strict HTTP security headers (CSP, HSTS, X-Frame-Options), executable file upload blacklists, and HTMLPurifier sanitization to prevent XSS and RCE attacks.
25
26
-**Backup Support:** Updates automatically trigger a full backup of modified files before applying patches, with a dedicated management interface for restores.
26
27
-**Theme system:** The `public/templates/*` structure and the `Modules\Theme` module enable installing or upgrading themes from ZIP packages.
27
28
-**Setup & automation:** Offers a web-based installer (`/install`) plus a single CLI command (`php spark ci4ms:setup`) for automated installation, default data seeding, and route generation. Module scaffolding is available via `php spark make:module`.
| Backup | Database backup manager | Create, download, and restore with SQL sanitization|
154
155
| DashboardWidgets | Dashboard statistics | Modular widget system for admin overview |
155
156
| LanguageManager | Language file manager | Edit and manage translation files from the backend |
156
157
@@ -184,7 +185,7 @@ Standard CodeIgniter commands (`php spark db:seed`, `php spark key:generate`, et
184
185
-`composer test` — runs PHPUnit.
185
186
- The GitHub Actions workflow (`.github/workflows/docker-test.yaml`) automatically builds the Docker image and runs migrations on every push to `master`.
186
187
-**Maintenance mode**: When `settings.maintenanceMode.scalar == 1`, the `Ci4ms` filter redirects visitors to `maintenance-mode`.
187
-
-**Security**: `Fileeditor` and `Media` enforce `realpath` guards. Limit access in production environments.
188
+
-**Security**: `Fileeditor`enforces `realpath` guards and a dangerous extension blacklist (`.php`, `.phtml`, `.phar`, `.htaccess`) to prevent RCE. `Backup` restore uses SQL statement whitelist to block malicious queries (`LOAD_FILE`, `GRANT`, etc.). `HTMLPurifier` config is hardened against XSS bypass (`data:` URIs blocked, `CSS.Trusted` disabled). All `$_SERVER` reads replaced with CI4 `base_url()`/`site_url()` helpers. Configure `App.php::$proxyIPs` if behind Cloudflare/Nginx.
0 commit comments