Window: Only accept valid window IDs

(cherry picked from commit 484bd26d63abef172d0354140adf9ce353c444e0)
This commit is contained in:
Johannes Meyer 2025-03-07 16:02:40 +01:00
parent 8e5b32aef3
commit 8600f4fe31

View File

@ -112,7 +112,7 @@ class Window
{
if (! isset(static::$window)) {
$id = Icinga::app()->getRequest()->getHeader('X-Icinga-WindowId');
if (empty($id) || $id === static::UNDEFINED) {
if (empty($id) || $id === static::UNDEFINED || ! preg_match('/^\w+$/', $id)) {
Icinga::app()->getResponse()->setOverrideWindowId();
$id = static::generateId();
}