Skip to content

Fix: Authentication Middleware in StatusPage#3310

Merged
ajhollid merged 8 commits intodevelopfrom
fix/be/status-page-access
Feb 20, 2026
Merged

Fix: Authentication Middleware in StatusPage#3310
ajhollid merged 8 commits intodevelopfrom
fix/be/status-page-access

Conversation

@Br0wnHammer
Copy link
Member

Describe your changes

This PR fixes a security vulnerability in the status page URL.

Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.

  • (Do not skip this or your PR will be closed) I deployed the application locally.
  • (Do not skip this or your PR will be closed) I have performed a self-review and testing of my code.
  • I have included the issue # in the PR.
  • I have added i18n support to visible strings (instead of <div>Add</div>, use):
const { t } = useTranslation();
<div>{t('add')}</div>
  • I have not included any files that are not related to my pull request, including package-lock and package-json if dependencies have not changed
  • I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
  • I made sure font sizes, color choices etc are all referenced from the theme. I don't have any hardcoded dimensions.
  • My PR is granular and targeted to one specific feature.
  • I ran npm run format in server and client directories, which automatically formats your code.
  • I took a screenshot or a video and attached to this PR if there is a UI change.
Screenshot 2026-02-19 at 23 55 07

@Br0wnHammer Br0wnHammer added this to the 3.4 milestone Feb 19, 2026
@Br0wnHammer Br0wnHammer self-assigned this Feb 19, 2026
@Br0wnHammer Br0wnHammer added the bug Something isn't working label Feb 19, 2026
Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution depends on route order, which isn't immediately obvious if you didn't review this PR and understand how it was implemented. It's not difficult to figure out, but we should try to avoid non-obvious solutions wherever possible, and I think we can do that here.

if (statusPage.isPublished) {
next(); // Published — proceed to controller (no JWT)
} else {
next("route"); // Unpublished — skip to next route (which has verifyJWT)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite brittle; it depends on the route order never changing, which is not obvious. Maintainers down the line won't know that this middleware depends on route order.

I think a more robust solution would be to have one route and just skip the JWT validation if the page is published

if (window.location.pathname !== "/login") {
if (
window.location.pathname !== "/login" &&
!window.location.pathname.startsWith("/status/public")
Copy link
Collaborator

@ajhollid ajhollid Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary I don't think 🤔 /status/public should never throw a 401 should it? If the page isn't published we should get a 403, if it is published we should get a 200?

Copy link
Collaborator

@ajhollid ajhollid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for revisions!

@ajhollid ajhollid merged commit 7bf83c1 into develop Feb 20, 2026
7 checks passed
@ajhollid ajhollid deleted the fix/be/status-page-access branch February 20, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants