1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-10-24 18:59:20 +03:00

1277 Commits

Author SHA1 Message Date
Dan Brown
f31273a10d Testing: Updated test to align with view block theme system changes 2026-09-24 17:13:36 +01:00
Dan Brown
cf133540b1 Search API: Review of #6182, to add page/book search API endpoints
- Updated examples to ensure they show results of the same page/book.
- Added method to controller to share the same request data logic.
- Tweaked tests.
2026-09-17 13:18:12 +01:00
Dan Brown
f791ce0eef Merge branch 'development' into enableservices-api-search-book-chapter-endpoints 2026-09-17 12:39:41 +01:00
Dan Brown
82b9472554 A11y: Review of #6173, ensure checkboxes are labelled
This specifically alters the checkbox label implementation to use the
existing checkbox label instead of always adding an extra label to the
custom checkbox element itself, unless they diverge (like for permission
checkboxes).
2026-09-15 19:20:14 +01:00
Dan Brown
b5641aa00d Testing: Updated app key test
To be better contained prevent impacting of other tests
2026-09-15 12:20:37 +01:00
Dan Brown
7782ea00df A11y: Improved alt tag usage for header logo
Set to blank if text is already part of the header, and the app name if
the name is not shown in the header.

For #6171
References:
https://webaim.org/techniques/alttext/
https://www.scottohara.me/blog/2018/05/05/hidden-vs-none.html
2026-09-15 12:07:00 +01:00
Dan Brown
278b94dd34 Merge branch 'v26-05-branch' into development 2026-09-15 03:27:23 +01:00
Dan Brown
ca205e3ed5 Config: Remove default app key value
To avoid scenarios where an instance specific app key is not set, and
therefore avoids the potential of instances using a known key value.

For #6210
2026-09-13 22:03:30 +01:00
Dan Brown
0763d7df30 Social Login: Fixed queries unscoped to driver
Prevents the same IDs from different systems leading to access of other
accounts, and allows registration of same ids under different services.

Thanks to Google and Ada Logics for discovery and reporting.
2026-09-13 17:27:01 +01:00
Dan Brown
13a1883b6c Page Filtering: Fixed table cell alignment being stripped
Cells could have an 'align' attribute, especially when created via
markdown. This updates the allow filtering to retain valid align values
on table cells.

For #6167
2026-09-03 13:19:07 +01:00
Dan Brown
18f8469a1c LDAP: Fixed handling of invalid group values
Updated LDAP group handling to properly handle empty group values by
checking the explode's count property instead of performing a general
array count.
Also updated logic with DN validation/filtering before LDAP calls are
made.

For #6088
2026-08-31 11:58:33 +01:00
Dan Brown
7539933d48 User Account: Require existing password on password change
For #6181
Just in users' my account area for now.
To add to admin-level actions in the future once we can better trace
session life.
Updated/added tests to cover.
2026-08-28 11:43:07 +01:00
Dan Brown
4a871811e9 API: Added changelog support to page create/update API
Also changed the UI based forms to submit as changelog instead of
summary to align with more sensible name used on the API.
Added testing to cover.

For #6162
2026-08-28 10:48:04 +01:00
Dan Brown
f1fe98d194 Pages API: Added extra test to cover type mismatch scenario
Related to #6136
2026-08-28 10:25:39 +01:00
Dan Brown
8603266f77 API Docs: Covered download endpoints with tests 2026-08-26 22:30:07 +01:00
Dan Brown
ff21f6b97c Merge pull request 'Configurable block layouts' (#6179) from sidebar_management into development
Reviewed-on: https://codeberg.org/bookstack/bookstack/pulls/6179
2026-08-25 14:11:14 +02:00
Dan Brown
2d6e60a9b3 Merge branch 'sec_aug26' into development 2026-08-24 13:25:55 +01:00
Dan Brown
e5a2832970 Page filtering: Fixed allow list stripping sftp and fragment links
Actually registered the SFTP protocol with HTMLPurifier to allow SFTP
links.
Replaced the default MakeAbsolute URI filter for HTMLPurifier so that
fragment based links are allowed, and are not forced to have a base URL
and/or protocol.

For #6178, Related to #6186
2026-08-24 00:03:06 +01:00
Dan Brown
0365dcc0b1 Page Drafts: Applied draft owner check to more endpoints
As a follow-up to e3068369a2, this applies
the draft ownership check to various other draft endpoints.

Thanks again to SVO for reporting.
2026-08-23 18:08:46 +01:00
Dan Brown
82a8cc35cf Recycle Bin: Ensure permissions are updated for deleted items
Fixed lack of permission update scope in permission builder where
trashed pages on chapter permission updates would not get permission
updates.

Also added permission rebuild on restore as an extra assurance.
Added tests to cover.

Thanks to SVO — svo.com.br for reporting.
2026-08-23 14:24:34 +01:00
Dan Brown
8f8a6ebf6a Content filtering: Fixed sftp protocols being removed
For #6186
2026-08-22 22:55:08 +01:00
Dan Brown
e210cc32e4 ZIP Imports: Prevented non-image creation via book cover
- Updates ZIP imports to validate that actual mime type of book cover
  images to ensure they are a supported image file.
- Updates lower level ImageStorage to validate extensions of images when
  cleaning their name pre-storage.
- Updates ZIP import Image and Book handling so book cover and image
  files have their extension forced from file mime types in the same
  way.

Added testing to cover.

Thanks to the submersion.ai security research team for reporting.
2026-08-22 18:46:31 +01:00
Dan Brown
b1991143b0 Search: Added draft filtering to generic entity list query
The lack of the filter could result in draft pages, from other users,
showing in locations like search results.

Thanks to Ahmed Ibrahim (github.com/skeletonsec) for reporting.
2026-08-21 12:07:25 +01:00
Dan Brown
e3068369a2 Pages: Prevent update of non-draft pages via draft publish
To prevent the ability to use the draft publish endpoint on non-draft
pages which the user may not have the ability to update by default.

Thanks to SVO for reporting.
2026-08-20 09:55:50 +01:00
Dan Brown
ac0348a79f Images: Added content checking and app range support to streaming
Mainly to prevent non-image files being streamed in scenarios where the
underlying image data is somehow a non-image.

Thanks to Emanuele Cervelli (https://github.com/M4nu02) for reporting.
2026-08-19 17:52:35 +01:00
Dan Brown
fbe83a1895 Drawings: Validated drawing upload content as image data
Specifically check the mime type of Base64 drawing data to ensure
that it reads as image data rather than anything else which could be
potentially dangerous.

Thanks to Emanuele Cervelli (https://github.com/M4nu02) for reporting.
2026-08-19 16:53:47 +01:00
Dan Brown
a889c18c02 Attachment API: Fixed missing check on attachment page change
On the change of an attachment uploaded_to (page) this ensures that a
PageUpdate permission check is made against the original attachment
page, in addition to the new page.

Thanks to Wade Sparks / ByteMe.Red for reporting.
2026-08-19 12:17:58 +01:00
Dan Brown
63082b53cc Layouts: Review and testing/CI update 2026-08-17 19:53:58 +01:00
Dan Brown
db50b14000 Layouts: Added logical theme event and guidance for block registration 2026-08-17 18:27:47 +01:00
Dan Brown
8760481fc2 Layouts: Added testing for access control, and view impact
Added a new middlware to properly handle per-request in-memory caching
within the app.
2026-08-16 23:03:40 +01:00
Dan Brown
404e048588 Layouts: Added reset to default action, made views dynamic
Shows only one homepage option depending on app homepage setting.
Only shows center column in editor for supported locations.
2026-08-16 14:12:30 +01:00
Dan Brown
01b29515c8 Layouts: Updated view block ids/labels to be static
So that their metadata can be read without having to create instances
and fullfill dependancy injection just to list.

Also added title to interface prefs page.
2026-08-16 10:41:43 +01:00
Dan Brown
b1c1cd134c Layouts: Added user preference load logic 2026-08-15 23:05:32 +01:00
Dan Brown
f98492e725 Layouts: Added update logic and testing 2026-08-15 20:43:56 +01:00
Dan Brown
10cf128598 Layouts: Started edit form ui, added block IDs 2026-08-12 15:43:00 +01:00
Enable Services
47f761c519 Support filtering by book and chapter in the api, to reflect the behaviour already supported in the UI. 2026-08-11 21:28:12 +01:00
Dan Brown
c79997e552 User Prefs: Added handling for lang and display mode
Included test to cover.
2026-08-11 14:32:18 +01:00
Dan Brown
a0108ae0ea Maintenance: Fixed test issues from recent changes 2026-07-28 15:19:20 +01:00
Dan Brown
badc4f9b8e Gallery API: Aligned image querying
Updated endpoint image querying to generally follow the same logic to
ensure filtering on just the expected types which are intended to be
managed by this endpoint, and it err on the side of caution in terms of
access control.
2026-07-28 14:29:36 +01:00
Dan Brown
2183fc7fc8 API: Limited exception details shown
Updated exception handler to reduce the amount of detail shown to
prevent potentially sensitive details (like internal paths) being shown
in the error message.

Added an interface for specifically marking exceptions whos messages we
may want to show.

Thanks to Tanner Marks for reporting.
2026-07-28 13:27:42 +01:00
Dan Brown
1732f15e4c External Auth: Updated user external auth id matching to be stricter
Added tests to cover.
Thanks to whale120 for reporting.
2026-07-27 21:23:47 +01:00
Dan Brown
cb195999eb Content Filter: Updated srcset and URI handling
- Added more complex srcset parsing and URI handling via custom built
  HTMLPurifier filter, which I've also provided upstream.
- Added a custom URI filter to force require URI schemes.
2026-07-27 12:12:07 +01:00
Dan Brown
0ada5d2dc9 Login: Added extra timing defenses for failed login attempts
- Adds a dummy hash attempt to balance the time of unknown user login
  attempt with known user login attempt to help prevent timing being
  used to indicate existing accounts.
- Adds some random variance to failed login attempts to help prevent
  timing based information discovery.

Thanks to Tanner Marks for their responsible disclosure of this.
2026-07-24 14:38:54 +01:00
Dan Brown
4e406c41c4 Attachments: Aligned update form permission checks with other actions
Thanks to Ashutosh Jena(MAVERICK-VF142) for reporting.
Not considered a significant security issue since it already required
page update permissions, which would generally be considered higher
privileged than the added page view.
2026-07-23 20:57:48 +01:00
Dan Brown
caeea658d1 Access: Hardened usage of referring URLs via login
Adds a more substantial URL check, via a new class which is shared and
used in other parts of the app for consistency.

Thanks to mfk25 for reporting.
2026-07-01 10:45:59 +01:00
Dan Brown
fe39b69c1f Comments: Added visibility check to comment delete
Aligns it with other actions/endpoints, and ensures an extra layer of
control against malicious use.

Thanks to mfk25 for reporting.
2026-07-01 10:20:32 +01:00
Dan Brown
01dc1e71c5 Attachments: Added more extensive URL filtering
Added a central URLFilter class to check & clean URLs used for
attachments, which is also used for validation, and by the purifier to
standardise protocols (and to make protocol config easier in future).

Thanks to mfk25 for reporting.
2026-07-01 00:41:19 +01:00
Dan Brown
59bbf504cf Content filtering: Added srcset protocol filter
Upstream libraries used did not specifically treat values in srcset as
URIs like other attributes, so this adds a simple filter for possible
bad values.
Updated tests to cover.

Thanks for Gurmandeep Deol for reporting.
2026-06-30 18:35:34 +01:00
Dan Brown
b7325fdf0e Attachments: Moved perm checks before validation
Avoids providing responses with potential sensitive attachment info
before permission checks.
Added tests to cover.

Thanks to Rafael Castilho for reporting.
2026-06-07 10:35:14 +01:00
Dan Brown
81f77a95de Content Filtering: Limited file protocol to just anchor hrefs
Updated allow list/purifier system to only allow file protocol use on
anchor hrefs to avoid potential security concerns with, after export,
content being auto loaded via interactive elements like
embeds/objects/videos etc...

Updated tests to cover.
Thanks to Gurmandeep Deol at Seneca Polytechnic for reporting.
2026-06-06 15:30:57 +01:00