Skip to content

Any URI starting with bolt.backend_url is treated as restricted #3504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lafor opened this issue Nov 10, 2023 · 1 comment
Open

Any URI starting with bolt.backend_url is treated as restricted #3504

lafor opened this issue Nov 10, 2023 · 1 comment

Comments

@lafor
Copy link

lafor commented Nov 10, 2023

Bolt treats any URI starting with bolt.backend_url string as restricted, even if not immediately followed by a slash.

Details

Question Answer
Relevant Bolt Version 5.1.24
Install type Composer install
PHP version 8.2

Reproduction

Steps to reproduce

Log out from the backend if logged in. Assuming your bolt.backend_url (as defined in config/services.yaml) is the default /bolt, try accessing an URI like /bolts-and-nuts.

Expected result

You should be served /bolts-and-nuts resource if it exists, or 404 if it doesn't.

Actual result

You're redirected to /bolt/login.

Fix

Paths ending with bolt.backend_url in access_control definitions of config/packages/security.yaml should include trailing slashes, e.g.:

- { path: '^%bolt.backend_url%/', roles: IS_AUTHENTICATED_REMEMBERED }
- { path: '^/(%app_locales%)%bolt.backend_url%/', roles: IS_AUTHENTICATED_REMEMBERED }

@macintoshplus
Copy link
Contributor

This issue fix must be applied in the repository and in project repository.

The route '/bolt$' must be protected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants