fix: keep zm.conf values out of the browser refs GHSA-jv9c-pg2m-5m6m

Since b2861d5cf loadConfig() returns the Config table merged with the
zm.conf and conf.d values that have no Config row. Those carry no
Private flag, and skin.js.php writes every config entry not marked
Private into each page as a JavaScript const, for any logged-in user
whatever their permissions. ZM_DB_USER and ZM_DB_PASS were in every
page, the permission error page included. The API's Configs listing
redacts by the same flag.

Mark values that exist only in the config files Private, apart from
ZM_DIR_SOUNDS, the one the browser uses (for the alarm sound).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Isaac ConnorandClaude Opus 5.5 committed 2026-10-07 08:09:33 -04:00
1 parent ddc4d67dd4
commit 22f9413333
1 file changed
+9
+9
View File
@@ -255,6 +255,15 @@ function loadConfig( $defineConsts=true ) {
}
}
}
# What is left exists only in zm.conf / conf.d: database credentials, paths and the
# like. Those have no Private column, and consumers such as skin.js.php export every
# entry that is not marked Private to the browser, so mark them Private unless they
# are known to be needed client side. refs GHSA-jv9c-pg2m-5m6m
$public_file_config = array('ZM_DIR_SOUNDS');
foreach ($initial_config as $name => $c) {
if (!isset($initial_config[$name]['Private']))
$initial_config[$name]['Private'] = in_array($name, $public_file_config) ? 0 : 1;
}
return array_merge($config, $initial_config); # Merge any remaining config not in db
} # end function loadConfig