/

CVE-2026-82450

Severity:

HIGH RISK

(8.8)

Unrestricted File Upload (CWE-434) in BookStack ZIP

CVE-2026-82450

Deferred

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

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 high-severity unrestricted file upload vulnerability in its portable ZIP import functionality. An attacker with Import Content and Create Books permissions may upload a PHP polyglot disguised as a book cover, causing the file to be stored in the public web root and executed through an unauthenticated request.

Affected context

The vulnerability occurs in BookStack deployments that enable portable ZIP imports and allow users to import content and create books. It becomes risky when archive entries are validated as images without adequately preventing server-side executable content from being stored in a web-accessible directory.

Exploit preconditions

  • Attack surface: Portable ZIP import functionality
  • Required access: An authenticated account with Import Content and Create Books permissions
  • Trigger point: Upload and processing of a book cover contained in an imported ZIP archive
  • Execution condition: The uploaded file must be placed beneath a publicly served web root where the server interprets its content as PHP
  • Why exploitation is possible: Image extension validation can be bypassed when archive content permits a PHP file with a .php filename to be treated as a cover image

Why this happens

The underlying issue is insufficient control over uploaded archive contents and file types, mapping to CWE-434: Unrestricted Upload of File with Dangerous Type. The import process trusts an image-related filename or extension without reliably enforcing allowed content types, executable-file exclusions, and safe storage boundaries. Storing the resulting file in a web-accessible location allows the application server to interpret an attacker-controlled upload as executable code.

Potential impact

  • An attacker could execute arbitrary PHP code on the application server
  • The application or its underlying host may be compromised
  • Sensitive application data or credentials could be accessed
  • BookStack content may be modified, deleted, or used for further attacks
  • The server could be used for lateral movement or malicious activity

General mitigation guidance

Mitigation generally focuses on treating archive uploads as untrusted content and preventing uploaded data from becoming executable.

Common defensive patterns include:

  • Allowing only explicitly supported image formats after inspecting file content rather than trusting filenames or extensions
  • Rejecting executable extensions and polyglot or ambiguous file formats
  • Extracting archives into isolated, non-public storage
  • Serving uploaded files through a controlled download path with non-executable response headers
  • Configuring the web server to disable script execution in all upload directories
  • Limiting import permissions according to least privilege
  • Applying archive size, nesting, path, and file-count restrictions
  • Separating uploaded content from application code and server-side runtime paths

How teams detect issues like this

Detection approaches can include:

  • Static analysis and code review checks for archive extraction followed by filename-only type validation
  • Searches for uploaded files being written beneath public web roots
  • Review of server configuration for script execution enabled in upload directories
  • Monitoring import events, archive extraction activity, and creation of unexpected executable extensions
  • File integrity monitoring for new PHP or other server-side script files in media directories
  • Policy enforcement requiring content-based file validation and isolated upload storage
  • Automated security review tools that flag dangerous file upload and archive-processing patterns

Sources

SourceLink
github.comgithub.com/BookStackApp/BookStack
github.comgithub.com/BookStackApp/BookStack/commit/e210cc32e4cbb1efeae5c5c9d0fef8e3c6a752e6
vulncheck.comvulncheck.com/advisories/bookstack-before-26.05.4-remote-code-execution-via-book-cover

Frequently asked

questions

Yes, exploitation can be initiated through the web application by an authenticated user who has the required import and book-creation permissions. Once the file is stored in a public web root, code execution may be triggered through an unauthenticated request.

No. The attacker generally needs both Import Content and Create Books permissions, so exploitability depends on role configuration and permission assignment.

Treat imported archives and their contents as untrusted, validate files by content, prevent executable formats, and store uploads outside executable web-accessible paths.

Use least-privilege permissions, isolate upload storage, disable script execution in media directories, enforce archive extraction policies, and continuously monitor for unexpected server-side files.

Find out what's already
exploitable in your codebase.