BookStack Security Release v26.05.4

BookStack v26.05.4 has been released.

This is a security release to address a range of vulnerabilities:

  • Users could update attachments on pages they did not have permission to update.
  • Request endpoints for drawings could be misused to create cross-site-scripting scenarios.
  • Draft page endpoints could be misused to alter non-draft pages without needing edit permission for those pages.
  • Draft pages created by other users could appear in certain search result lists.
  • ZIP imports with certain content could lead to a remote-code-execution scenario.
  • Page visibility rules may not be updated in certain recycle-bin-related scenarios.

Updating is generally advised, but strongly so where untrusted users have general access to the instance.

If untrusted users do have access, especially edit level access, it’s advised to double check image upload folders to ensure there’s no unexpected non-image content. On a typical Linux-based system installation, this could be done using the find command from the BookStack installation folder like so:

1
2
3
4
5
# Check the general "public" server space
find ./public/uploads -type f ! \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.webp" -o -iname "*.avif" -o -iname ".gitignore" -o -iname ".htaccess" \)

# Check the internal image storage space
find ./storage/uploads/images -type f ! \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.webp" -o -iname "*.avif" -o -iname ".gitignore" -o -iname ".htaccess" \)

A big thanks to the following researchers for responsibly reporting vulnerabilities which were addressed in this release:

Full List of Changes

  • Updated image serving with additional MIME-based content type check.
  • Updated PHP package versions.
  • Updated translations with the latest Crowdin changes.
  • Fixed issue where anchor links would be removed or be made invalid. (#6178)
  • Fixed issue where sftp links would be removed from content. (#6186)
  • Fixed lack of content validation when storing base64 drawing content.
  • Fixed lack of permission check on draft endpoints.
  • Fixed lacking content validation checks on book covers during ZIP imports.
  • Fixed missing update permission check on attachment API.
  • Fixed scenario where joint permission table would not be updated for chapter pages which are in the recycle bin.
  • Fixed search queries not filtering out drafts from other users.

For More Information

You can find update instructions here.
If you have any questions or comments about this advisory:


Header Image Credits: Photo by Dietmar Rabich (cc-by-sa-4) - Image Modified