| Title | Sergio Brighenti XBackBone 3.8.2 Cross Site Scripting |
|---|
| Description | XBackBone 3.8.2 implements a helper, must_be_escaped() (app/helpers.php:499), which marks
image/svg and text/htm as content types that must not be rendered inline by the browser.
The guard is applied in MediaController::getRaw() (app/Controllers/MediaController.php:161)
but not in MediaController::getRawById() (app/Controllers/MediaController.php:117-126).
getRawById() backs the route GET /upload/{id}/raw (app/routes.php:68), which the admin
interface uses to preview uploads. Because the guard is missing, the stored file is returned
with its original MIME type and an inline disposition, so a user-supplied SVG is rendered as
an SVG document and its embedded script executes in the application origin.
Uploads are not content-validated, so any authenticated user - including a regular,
non-administrative account - can store the payload. getRawById() also does not verify that
the requested upload belongs to the caller, so an attacker can direct an administrator to any
upload id.
A regular user can therefore execute arbitrary JavaScript in an administrator's session and
perform authenticated administrative actions. The session cookie is HttpOnly, so it cannot be
read via document.cookie, but the script can issue authenticated same-origin requests; in our
test it read the admin dashboard (45,665 characters).
The same file served through GET /{userCode}/{mediaCode}/raw.svg returns Content-Type
text/plain and does not execute, which confirms the issue is a missing call rather than
intended behaviour.
Proof of concept:
1. Install the official 3.8.2 release package.
2. As admin, create a regular user (no admin rights, active).
3. Log in as that user; GET /system returns 403.
4. Upload an SVG containing onload="..." via the Upload page (no content validation).
5. Note the upload id N from the dashboard card (data-id="N").
6. As admin, open GET /upload/N/raw -> HTTP 200 with Content-Type: image/svg+xml;
the browser executes the script.
A fix is provided as a pull request:
https://github.com/sergix44/xbackbone/pull/673 |
|---|
| User | joshyuan (UID 102239) |
|---|
| Submission | 10/19/2026 16:05 (1 month ago) |
|---|
| Moderation | 11/13/2026 21:33 (25 days later) |
|---|
| Status | Accepted |
|---|
| VulDB entry | 437311 [sergix44 XBackBone up to 3.8.2 MediaController.php getRawById cross site scripting] |
|---|
| Points | 17 |
|---|