Skip to content

[Log Rocket] /broadcasting/auth 403 on multiple customers#8737

Open
marcoAntonioNina wants to merge 6 commits intodevelopfrom
bugfix/FOUR-24910
Open

[Log Rocket] /broadcasting/auth 403 on multiple customers#8737
marcoAntonioNina wants to merge 6 commits intodevelopfrom
bugfix/FOUR-24910

Conversation

@marcoAntonioNina
Copy link
Contributor

@marcoAntonioNina marcoAntonioNina commented Feb 20, 2026

Issue & Reproduction Steps

The 403 error is because it has permissions on the broadcasting channel.

Solution

  • This could be due to a lost session; defensive code is used here to prevent subscriptions if the user doesn't exist.
  • Middleware is added to view the 403 error and capture more information when this problem occurs. A variable, BROADCAST_AUTH_DEBUG, is used to enable this logging.

How to Test

The steps to reproduce the problem are uncertain; you should only check that notifications are working correctly.

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

ci:deploy


Note

Medium Risk
Touches broadcast authentication middleware/client subscription behavior and channel authorization callbacks, which can affect realtime notifications if misconfigured. Changes are gated for logging via BROADCAST_AUTH_DEBUG, but the stricter anonymous-user checks may alter who can subscribe to channels.

Overview
Reduces intermittent /broadcasting/auth 403s by making broadcast auth requests more reliable and easier to diagnose.

Adds BroadcastAuthDebug middleware (enabled via BROADCAST_AUTH_DEBUG) to log detailed context only when broadcast auth returns 4xx/5xx, and moves broadcast route registration to BroadcastServiceProvider with auth:web,anon plus this middleware.

Tightens broadcast channel authorization to explicitly deny missing/AnonymousUser principals and consistently return false for invalid inputs, and updates the JS Echo bootstrap to force same-origin authEndpoint with credentials and to no-op private subscriptions when there is no current user or when subscribing to another user’s channel.

Written by Cursor Bugbot for commit 9ff5e1f. This will update automatically on new commits. Configure here.

…equests

- Introduced BroadcastAuthDebug middleware to log failed broadcast authentication attempts (HTTP status codes 401, 403, 500) for debugging purposes.
- Updated BroadcastServiceProvider to include the new middleware in the broadcast routes.
- Enhanced private channel subscription logic in bootstrap.js to prevent 403 errors when no user is authenticated.
- Updated channels.php to ensure anonymous users are denied access to specific channels.
…are directed to the Laravel app with cookies, reducing CORS-related 403 errors.

- Added logic to handle user ID extraction from private channels, preventing subscription to channels of other users.
- Improved error handling for private channel subscriptions when no user is authenticated.
… channel information parsing

- Updated BroadcastAuthDebug middleware to log additional details on failed broadcast authentication attempts, including user anonymity and channel type.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 21

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

'status' => $response->getStatusCode(),
'user_id' => $user?->id,
'user_type' => $user ? get_class($user) : null,
'user_is_anonymous' => $user && method_exists($user, 'isAnonymous') ? $user->isAnonymous : null,
Copy link

Choose a reason for hiding this comment

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

method_exists check fails for isAnonymous property

Medium Severity

isAnonymous is defined as a public property (public $isAnonymous = true;) on AnonymousUser, not a method. Using method_exists($user, 'isAnonymous') will always return false, so user_is_anonymous will always be logged as null — even for anonymous users. This undermines the debug middleware's ability to diagnose the exact 403 scenario it was built to investigate. The check needs property_exists instead.

Fix in Cursor Fix in Web

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@Kookster310
Copy link
Contributor

QA server K8S was successfully deployed https://ci-938cf714d0.engk8s.processmaker.net

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants