- Fix path traversal with realpath() validation in getPage() and executePhpFile() - Remove insecure JWT secret fallback, require JWT_SECRET env var - Fix IP spoofing by only trusting proxy headers from configured proxies - Add Secure/HttpOnly/SameSite flags to all cookies - Use env var for debug mode instead of hardcoded true - Fix operator precedence bug in MQTTTracker track_user_flows check - Remove dead code: duplicate is_dir() block, unused scanForPageNames() - Remove htmlspecialchars() from filesystem path operations - Remove duplicate require_once calls and redundant autoloader includes - Fix unclosed </div> in getDirectoryListing() - Escape breadcrumb titles and add lang param to search result URLs - Make language prefixes dynamic from config instead of hardcoded nl|en - Make HTML lang attribute dynamic, add go_to translation key - Add aria-label/aria-expanded to sidebar toggle for accessibility - Fix event listener leak in app.js using event delegation - Remove console.log from production code - Update guides (NL/EN) with sidebar toggle documentation - Add TODO.md documenting all identified improvements
4.2 KiB
4.2 KiB
CodePress CMS - Verbeteringen TODO
Kritiek
- Path traversal fix -
str_replace('../')ingetPage()is te omzeilen. Gebruikrealpath()met prefix-check (CodePressCMS.php:313) - JWT secret fallback - Standaard
'your-secret-key-change-in-production'maakt tokens forgeable (admin-console/config/app.php:11) - executePhpFile() onveilig - Open
includewrapper zonder pad-restrictie (CMSAPI.php:164) - Plugin auto-loading - Elke map in
plugins/wordt blind geladen zonder allowlist of validatie (PluginManager.php:40)
Hoog
- IP spoofing -
X-Forwarded-Forheader wordt blind vertrouwd in MQTTTracker (MQTTTracker.php:211) - Debug hardcoded -
'debug' => truehardcoded in admin config (admin-console/config/app.php:6) - Cookie security - Cookies zonder
Secure/HttpOnly/SameSiteflags (MQTTTracker.php:70) - autoLinkPageTitles() - Regex kan geneste
<a>tags produceren (CodePressCMS.php:587) - extract($data) - Kan lokale variabelen overschrijven in AuthController (
AuthController.php:77) - MQTT wachtwoord - Credentials in plain text JSON (
MQTTTracker.php:37)
Medium
- Dead code - Dubbele
is_dir()check, tweede blok onbereikbaar (CodePressCMS.php:328-333) - htmlspecialchars() op bestandspad - Corrumpeert bestandslookups in
getPage()engetContentType()(CodePressCMS.php:311, 1294) - Ongebruikte methode -
scanForPageNames()wordt nergens aangeroepen (CodePressCMS.php:658-679) - Orphaned docblock - Dubbel docblock zonder bijbehorende methode (
CodePressCMS.php:607-611) - Extra
</div>- Sluit een tag die nooit geopend is ingetDirectoryListing()(CodePressCMS.php:996) - Dubbele require_once - PluginManager/CMSAPI geladen in zowel index.php als constructor (
CodePressCMS.php:49-50) - require_once autoload - Autoloader opnieuw geladen in
parseMarkdown()(CodePressCMS.php:513) - Breadcrumb titels ongeescaped -
$titledirect in HTML zonderhtmlspecialchars()(CodePressCMS.php:1197) - Zoekresultaat-URLs missen
&lang=- Taalparameter ontbreekt (CodePressCMS.php:264) - Operator precedence bug -
!$x ?? trueevalueert als(!$x) ?? true(MQTTTracker.php:131) - Taalwisselaar verliest pagina - Wisselen van taal navigeert altijd naar homepage (
header.mustache:22) - ctime is geen creatietijd op Linux -
stat()ctime is inode-wijzigingstijd (CodePressCMS.php:400) - getGuidePage() dupliceert markdown parsing - Zelfde CommonMark setup als
parseMarkdown()(CodePressCMS.php:854) - HTMLBlock ontbrekende
</div>- Niet-gesloten tags bij null-check (HTMLBlock.php:68) - CSRF-bescherming - Login form zonder CSRF token (
AuthController.php:18) - formatDisplayName() redundante logica - Dubbele checks en overtollige str_replace (
CodePressCMS.php:688)
Laag
- Hardcoded 'Ga naar' - Niet vertaalbaar in
autoLinkPageTitles()(CodePressCMS.php:587) - HTML lang attribuut -
<html lang="en">hardcoded i.p.v. dynamisch (layout.mustache:2) - console.log in productie - Debug log in app.js (
app.js:54) - Event listener leak - N globale click listeners in forEach loop (
app.js:85) - Sidebar toggle aria - Ontbrekende
aria-labelenaria-expanded(CodePressCMS.php:1171) - Taalprefix hardcoded - Alleen
nl|eni.p.v. dynamisch uit config (CodePressCMS.php:691, 190) - Geen type hints - Ontbrekende type declarations op properties en methoden
- Public properties -
$config,$currentLanguage,$searchResultszouden private moeten zijn - Inline CSS - ~250 regels statische CSS in template i.p.v. extern bestand
- style.css is Bootstrap - Bestandsnaam is misleidend, Bootstrap wordt mogelijk dubbel geladen
- Geen error handling op file_get_contents() - Meerdere calls zonder return-check
- Logger slikt fouten -
@file_put_contents()met error suppression - Logger tail() leest heel bestand - Geheugenprobleem bij grote logbestanden
- Externe links missen rel="noreferrer"
- Zoekformulier mist aria-label
- mobile.css override Bootstrap utilities met
!important