Skip to content

CAppUI::isActiveModule() interpolates the module name into SQL and runs a query on every call #457

Closed

Description

@caseysoftware

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

  1. added a commit that references this issue on Oct 24, 2026
    640481c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions