From 8c49be86bf2281c6a376516175cf65a1ab7e4e4d Mon Sep 17 00:00:00 2001 From: TheWitness Date: Wed, 7 Oct 2026 16:15:57 -0400 Subject: [PATCH 1/3] security: move filter inline onChange handlers into ready() for CSP The WMI Accounts and Queries filter pages each carried an inline onChange='applyFilter()' attribute on their rows selector. Under Cacti's Content-Security-Policy these trip the script-src-attr directive (inline event handlers). Bind the selects in each page's existing $(function(){...}) ready block alongside the Refresh/Clear/submit bindings already there. Regenerated locales/po/cacti.pot for the shifted source line references. wmi_accounts.php and wmi_queries.php are already in the patch-coverage gate's allowlist. The cactiReturnTo() cancel buttons are left inline (shared Cacti-core pattern, tracked separately). --- CHANGELOG.md | 1 + locales/po/cacti.pot | 1 + wmi_accounts.php | 6 +++++- wmi_queries.php | 6 +++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88fa878..2a38e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ --- develop --- +* security: Move the WMI Accounts and Queries filter rows selects' inline onChange handlers into the ready block so the pages no longer trip Cacti's Content-Security-Policy script-src-attr directive * dev: Measure CI coverage with xdebug instead of pcov so the plugin's own sources are instrumented (pcov auto-scopes to the Composer root and skipped cacti/plugins/, leaving the patch-coverage gate with nothing to measure) * dev: Enforce patch coverage of changed lines in CI and remove the inert COMPOSER_ROOT_VERSION env from the Pest step * security: Add a version-safe CSP nonce (`plugin_wmi_csp_nonce()`) to every inline `