Bludit Pro 3.22.0: Advisory Round 2

The patches

Seven CVEs across nine files. The two High-severity findings come first, then the Mediums. The descriptions below come from the CVE records, not from the manifest — in a few cases the two differ in ways that matter.

CVE-2026-107190 — Path traversal in page deletion (High, 7.0)

Files: bl-kernel/pages.class.php (delete(), add(), edit()), bl-kernel/helpers/filesystem.class.php (deleteRecursive())

An authenticated Author could set their own page's UUID to contain .. and path separators. The value was persisted without validation, then joined into the delete paths, so deleting the page could remove arbitrary files and directories — including admin pages, which takes the site down. Vendor contact attempts went unanswered, and the CVE is confirmed in 3.22.0.

Fix — three layers. First, delete() rejects any key that isn't a plain slug path:

if (!preg_match('#^[a-zA-Z0-9_\-]+(/[a-zA-Z0-9_\-]+)*$#', $key)) {
    Log::set(__METHOD__ . LOG_SEP . 'Invalid page key rejected. Key: ' . $key);
    return false;
}

Second, the UUID is no longer client-controllable. add() always generates it server-side, and edit() keeps the stored value immutable:

// In add(): always system-generated
$row['uuid'] = $this->generateUUID();

// In edit(): immutable, taken from the existing row
$row['uuid'] = $this->db[$key]['uuid'];

Third, deleteRecursive() rejects traversal outright as a defense-in-depth layer, so even a path that reaches it can't climb the tree:

if (strpos($source, '..') !== false) {
    Log::set('deleteRecursive rejected (path traversal): ' . $source, LOG_TYPE_ERROR);
    return false;
}

CVE-2026-82038 — Stale session role after demotion (High, 7.4)

File: bl-kernel/login.class.php (isLogged())

A session issued while an account held administrator privileges would keep authorizing admin actions after the account was demoted, because isLogged() confirmed the user still existed but never re-read their role. The session value from login time stayed in place, which is how a demoted admin goes on creating new admin accounts.

Fix: re-read the persisted role on every isLogged() check and re-sync the session when it differs. The fallback is author, the least-privileged role, so a missing value fails closed:

$storedRole = isset($userDB['role']) ? $userDB['role'] : 'author';
if (Session::get('role') !== $storedRole) {
    Session::set('role', $storedRole);
    Log::set(__METHOD__ . LOG_SEP . 'Role changed on disk, session re-synced. Username: ' . $username);
}

CVE-2026-93364 — Mass assignment in Pages::edit() (Medium, 5.3)

File: bl-kernel/pages.class.php (edit(), add())

An Author could inject reserved fields like type and username into a save request, and edit() would accept them, because it iterates every field in dbFields without per-field authorization. The result is that an Author could convert pages to static navigation entries or transfer ownership to another account. This is the CVE the manifest got wrong — it described a media AJAX issue and proposed a fix that wouldn't have touched this code path at all.

Fix: a model-layer filter strips privileged types and username for non-admin callers. On create, the caller always owns the page; on edit, ownership is immutable:

protected $privilegedTypes = array('static', 'sticky');

private function filterReservedFields($args, $isNewPage = false)
{
    global $login;

    if (isset($login) && is_object($login) && $login->isLogged() && $login->role() !== 'admin') {
        if (isset($args['type']) && in_array($args['type'], $this->privilegedTypes, true)) {
            unset($args['type']);
        }

        if ($isNewPage) {
            $args['username'] = $login->username();
        } else {
            unset($args['username']);
        }
    }

    return $args;
}

The same guard covers parent inheritance. A non-admin creating a child page under a static or sticky parent can't inherit the privileged type through the $row['type'] = $this->db[$parent]['type'] path, which is an edge case that exists in both add() and edit(), and both are patched.

CVE-2026-82037 — Missing authorization on logo AJAX (Medium, 5.3)

Files: bl-kernel/ajax/logo-upload.php, bl-kernel/ajax/logo-remove.php

The logo endpoints accepted requests from any authenticated user, so an Author or Editor could replace the site logo or delete it. Site branding is administrator-only, and there's no good reason for it to be a per-role operation.

Fix: a gate before any file logic. Both files get the same three-condition check — the login object exists, the user is logged in, and the role is admin — and ajaxResponse() stops execution on failure:

global $login;
if (!is_object($login) || !$login->isLogged() || $login->role() !== 'admin') {
    ajaxResponse(1, 'You do not have permission to perform this action.');
}

CVE-2026-95153 — Information disclosure via clippy / save-as-draft (Medium)

Files: bl-kernel/ajax/clippy.php, bl-kernel/ajax/save-as-draft.php

The advisory names both endpoints. In practice, clippy.php was already safe — the first audit added the role filter, and its response only ever returned id, text, and type, never content. save-as-draft.php was the real gap: it resolved a page by UUID and let a caller edit it without checking who owned it.

Fix: an ownership gate between the UUID lookup and the create/edit branch:

$pageKey = $pages->getByUUID($uuid);

if (!empty($pageKey)) {
    if (checkRole(array('author','editor'), false)) {
        if (!isset($pages->db[$pageKey]['username']) || $pages->db[$pageKey]['username'] !== $login->username()) {
            ajaxResponse(1, 'You do not have permission to perform this action.');
        }
    }
}

CVE-2026-93365 — Draft and scheduled post disclosure (Medium)

File: bl-kernel/ajax/content-get-list.php

An Author or Editor could pass draft=true to the content list endpoint and receive the full content of private drafts and scheduled posts belonging to other users, including administrators. The endpoint built the list from every page matching the type filter and returned json(true) — full content — without any ownership check.

Fix: filter non-admin results to the caller's own pages before the page object is built:

foreach ($pagesKey as $pageKey) {
    if (checkRole(array('author','editor'), false)) {
        if (isset($pages->db[$pageKey]['username']) && $pages->db[$pageKey]['username'] !== $login->username()) {
            continue;
        }
    }

    // ... page build and match ...
}

CVE-2026-93366 — Authorization bypass via list-images / delete-image (Medium, 5.3)

Files: bl-kernel/ajax/list-images.php, bl-kernel/ajax/delete-image.php

An Author could enumerate page UUIDs through the content list, then pass another user's UUID to the media endpoints to list or delete their files. The endpoints checked that the UUID didn't contain path separators, but never checked who owned the page.

Fix: resolve the UUID to an owner and enforce the role check before any file operation. Both files carry the same pattern:

$ownerKey = $pages->getByUUID($uuid);
if (empty($ownerKey)) {
    ajaxResponse(1, 'Page not found.');
}
if (checkRole(array('author','editor'), false)) {
    if (!isset($pages->db[$ownerKey]['username']) || $pages->db[$ownerKey]['username'] !== $login->username()) {
        ajaxResponse(1, 'You do not have permission to perform this action.');
    }
}

The manifest proposed a shared helper — ajaxRequirePageOwnership() — that doesn't exist anywhere in the codebase. I implemented the same guarantees inline in each file instead. For a fork maintained by hand, that's the better trade: the logic is visible at every call site, and there's no helper to drift or forget to include.

Files changed across the round: pages.class.php, login.class.php, filesystem.class.php, logo-upload.php, logo-remove.php, clippy.php (verified, no change needed), save-as-draft.php, content-get-list.php, list-images.php, delete-image.php. Every file was checked with php -l after patching, and the admin panel was smoke-tested through create, edit, upload, delete, and logo change.