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
{{ message }}
Repository navigation
CAppUI::isActiveModule() interpolates the module name into SQL and runs a query on every call #457
w2p_Core_CAppUI::isActiveModule() (classes/w2p/Core/CAppUI.class.php L1068) interpolates its argument straight into the query:
$q->addWhere("mod_directory = '$module'");
Every current caller passes a literal module name (departments, contacts, holiday, …, plus TitleBlock crumbs), so this isn't exploitable today, but any future caller passing request data would be SQL injection.
It also isn't cached: every call is a query. TitleBlock calls it once per breadcrumb, and isWorkingDay() called it once per calendar cell (about 500 queries on the year view) until a local fix cached that one lookup.
Fix: bind or escape the value instead of interpolating it, and cache the active-module list once per request (e.g. load mod_directory, mod_active for all modules into a static array on first call).
Activity
CAppUI::isActiveModule(): load the module list once per request