mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-08 03:09:39 +03:00
Calls to manifest, without a referrer, affect session history and back redirect navigation #4296
Closed
opened 2026-02-05 08:27:49 +03:00 by OVERLORD
·
13 comments
No Branch/Tag Specified
development
further_theme_development
l10n_development
release
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🐛 Bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#4296
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ntimo on GitHub (Nov 5, 2023).
Describe the Bug
When logging in with OIDC the login is successful, but the browser is then redirected to
/manifest.jsonwhich is confusing, since the user should be redirected to the normal Booktack interface. But after removing /manifest.json from the url to open booktack normally the user is logged in.Steps to Reproduce
Expected Behaviour
The normal landing page should be open on the / url.
Screenshots or Additional Context
My OIDC callback is configured to `/oidc/callback
Browser Details
Chrome Linux
Exact BookStack Version
v23.10.1
@ssddanbrown commented on GitHub (Nov 5, 2023):
Hi @ntimo,
Thanks for reporting, but I have been unable to reproduce this on either Firefox or Chrome (on Fedora 39) in my testing.
@ntimo commented on GitHub (Nov 5, 2023):
@ssddanbrown Yes I just tested this with Firefox and there the issue does not happen. But when using Chrome or Chromium it happens, which is kind of odd. The Chromium I tested this with has 0 extensions installed.
Chromium version: Version 118.0.5993.70 (Official Build) Fedora Project (64-bit)
@ssddanbrown commented on GitHub (Nov 5, 2023):
Realised my Chromium was a bit behind. Updated but still works fine for me.
I could kind see ways how this could occur if the manifest was being loaded on every page load, but not sure why that might be, and have not been able to quickly force-replicate that scenario.
/manifest.jsonon your instance show JSON in response (including your BookStack instance name)?<link rel="manifest", does thehrefURL exactly match<BOOKSTACK_APP_URL>/manifest.jsonwhere<BOOKSTACK_APP_URL>is the base URL for your BookStack instance? No double slashes or different https/http protocol used?@ntimo commented on GitHub (Nov 5, 2023):
<link rel="manifest" href="https://bookstack.domain.com/manifest.json" crossorigin="use-credentials">Maybe its worth noting that I am using the linux server docker image to host booktack
@ghost commented on GitHub (Nov 6, 2023):
I can reproduce this, just by clicking the Toggle dark mode button even without being logged. It fails on Firefox on Android, but works on Firefox for Desktop.
@ssddanbrown commented on GitHub (Nov 6, 2023):
@fdelapena Is this reproducible on our demo instance? If not, how are you running/hosting BookStack?
@arl4223 commented on GitHub (Nov 6, 2023):
Hello,
as mentioned on the Discord server I encounter the same issue.
For further testing I set up a different notebook. My primary laptop is an Apple MacBook Pro. The testing device is an Lenovo Thinkpad. One is running the latest macOS and the other one is running Ubuntu 22.04 LTS.
When I switch to dark mode on the macOS system I get the
/manifest.jsonerror. If I login to my instance on the Ubuntu system and switch to dark mode a thumbnail is shown and the URL is amended with/uploads/images/cover_bookshelf/2023-11/thumbs-440-250/XXX.pngwhereXXXis a redacted filename so I do not disclose private details. This is running Firefox without any plugins. It was just setup fresh for testing this issue.Both ways are reproducible.
Let me know if I can provide more information which can help.
@ghost commented on GitHub (Nov 7, 2023):
Can't reproduce it on the demo instance. The server setup is:
APP_URL=https://foo.example.orgbefore running the initial php artisan migrate. APP_KEY also looked fine. Deployment was pretty similar to documentation setup instructions.@arl4223 commented on GitHub (Nov 7, 2023):
I don't know if this helps but I found another way to reproduce this issue: when ever I change the view from
gridtolistor the other way around I will see the/manifest.jsonsite.@ssddanbrown commented on GitHub (Nov 7, 2023):
Thank you @fdelapena, @ntimo and @arl4223 for all the extra information.
I have now been able to reproduce this.
This specifically occurs in environments where no refferrer header is passed (possible browser control or via a server-side
no-referrerpolicy as demonstrated above) and where the browser frequently requests the manifest file.When no referrer is provided, then BookStack will fall back to the last url requested in the session, which ends up being the manifest file.
This was made a little more annoying to reproduce by browsers seemingly having strict and differing behaviour as to when the manifest would be requested. Self-signed certs, or private windows, would change the behaviour.
I'll update the manifest link to not pass credentials, so a session is not used for this call and therefore this isn't added to the user session history.
It does mean we can't customize the colors of the manifest to the user's dark mode preference, but I think that's a fair trade to avoid this issue for now.
A better way to address this would be to avoid this URL being tracked but that requires some deeper overriding of the framework, which I wouldn't want to do in a patch and I'm not sure it'd be worthwhile to maintain.
Will get a patch release out soon.
@arl4223 Your example with redirect to the image is of the same underlying cause, but specifically when certain image storage options are in use and/or when images are missing/broken. I won't address that specific case right now, since that hasn't be really reported as an issue and would have existed for a long time already, but it's tied up within the above.
If it's specifically problematic within an environment, this could be helped by allowing a
referrerto be used within the environment (You can limit to same-origin if needed).@ssddanbrown commented on GitHub (Nov 7, 2023):
I have now patched this via
ea0469e61ato avoid manifest calls using the session as per the above.I've opened up #4656 with the intent to implement a longer-term solution for this (and similar cases like the image example).
This patch will be part of v23.10.2 which should be released within the next hour or so.
@arl4223 commented on GitHub (Nov 7, 2023):
I have just deployed the mentioned update and can confirm, that the
manifest.jsonist not the issue anymore.Instead I get the "image" issue. I will have a look into the
referreroption mentioned above.@arl4223 commented on GitHub (Nov 7, 2023):
Adding
add_header 'Referrer-Policy' 'origin';to my nginx config helped.