/

CVE-2026-84695

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in BookStack Drawing Upload Endpoint

CVE-2026-84695

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Administrative session compromise and unauthorized actions

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

BookStack contains a stored cross-site scripting vulnerability in its drawing upload endpoint, where editor-level users can submit SVG content containing scripts. When the uploaded content is later accessed through the image gallery API, the script may execute in an administrator's browser because content is not sufficiently validated or protected by appropriate browser controls.

Affected context

The issue occurs in BookStack deployments where users with editor permissions can upload drawings through the affected endpoint. Risk increases when base64-encoded content is stored without inspection, SVG files are served without content-type enforcement, and gallery responses lack effective Content Security Policy protections.

Exploit preconditions

  • Attack surface: Drawing upload and image gallery API functionality - Required access: An account with editor-level permissions or equivalent

upload capability

  • Trigger point: An administrator or other privileged user accesses the

uploaded drawing through the gallery

  • Why exploitation is possible: Unvalidated SVG content can be stored and

returned in a browser-executable context without adequate content-type or

script-execution restrictions

Why this happens

The vulnerability results from treating uploaded, base64-encoded content as trusted image data without validating its actual file type or inspecting active content. SVG files can contain script-capable markup, and serving them without appropriate response headers or browser isolation allows stored attacker-controlled content to execute in a victim's origin. This behavior maps to CWE-79, Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • An attacker may execute script in an administrator's browser context.
  • The vulnerability could enable unauthorized actions using the victim's session.
  • Sensitive information accessible to the victim may be exposed.
  • Administrative settings or stored content may be modified.
  • The application could be used to distribute persistent malicious content.

General mitigation guidance

Mitigation generally focuses on reducing trust in uploaded content and ensuring that user-controlled files cannot execute as active web content. Defensive patterns include decoding and validating uploads against a strict allowlist, rejecting script-capable formats when they are unnecessary, sanitizing SVG content with a well-maintained restrictive policy, and storing untrusted files outside the application origin where practical. Responses should enforce safe content types, prevent content sniffing, and apply a restrictive Content Security Policy. Upload and gallery capabilities should follow least privilege, with editor permissions limited to the smallest necessary scope.

How teams detect issues like this

Detection can include static analysis for upload handlers that persist user-controlled base64 data without file-type validation or sanitization. Code review should examine SVG handling, response Content-Type behavior, content-disposition settings, gallery API responses, and the presence of effective CSP policies. Dynamic testing can use benign marker files to verify that script-capable content is rejected or served as inert downloads. Policy enforcement may require approved file-type allowlists, centralized upload validation, and automated security checks in CI. Neutral automated code-review and dependency-analysis tools may help identify related patterns.

Sources

SourceLink
github.comgithub.com/BookStackApp/BookStack
github.comgithub.com/BookStackApp/BookStack/blob/v26.05.3/app/Uploads/ImageService.php
github.comgithub.com/BookStackApp/BookStack/commit/ac0348a79f3ddd004ca87703948cb9c7d19a420a
github.comgithub.com/BookStackApp/BookStack/releases/tag/v26.05.4
bookstackapp.combookstackapp.com/blog/bookstack-release-v26-05-4/
vulncheck.comvulncheck.com/advisories/bookstack-before-26.05.4-stored-xss-via-drawing-upload

Frequently asked

questions

It may be exploitable through the application's web interface when an attacker

with editor permissions can upload a crafted drawing and a privileged user

later views it.

No. The uploader generally needs editor-level permissions, while an

administrator or another privileged user must access the stored content for

the highest-impact outcomes.

Treat uploads as untrusted, allow only required file types, sanitize or reject

active SVG content, and serve retained files with safe response headers and

browser isolation.

Combine strict upload validation with least-privilege permissions, secure

storage outside the application origin where feasible, CSP enforcement, and

automated tests covering stored content execution.

Find out what's already
exploitable in your codebase.