Skip to content

Menu item click

Each menu link in the side and top menus posts to the MenuItemClick page handler with the target application and page. The handler turns the post into a navigation.

Field Value
Operation ID OP-09
Trigger POST to the MenuItemClick handler
Inputs targetApp, targetPage
Outputs Redirect result
Primary components BolMenuModel.OnPostMenuItemClick, BolMenuModel.OnNavigate
Entry point src/BolMiddleware/Models/BolMenuModel.cs

Steps

  1. Build NavigationOptions from the posted targetApp and targetPage.
  2. Call the virtual OnNavigate hook so the consumer can adjust the options.
  3. Run Navigate, which saves the context (BR-BOLMIDDLEWARE-002) and returns the redirect.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([POST MenuItemClick]) --> S1[Build NavigationOptions]
    S1 --> S2[OnNavigate hook]
    S2 --> S3[Navigate]
    S3 --> EndOk([Redirect])

Failure and edge-case behavior

  • The redirect target is built from posted values with no allow-list, so a crafted post can redirect to an arbitrary application and page.
  • Anti-forgery validation is disabled on the page class, so the post can be forged cross-site.

Sources

  • src/BolMiddleware/Models/BolMenuModel.cs
  • src/BolMiddleware/Contracts/NavigationOptions.cs
  • src/BolMiddleware/Pages/Shared/_BolMenuItemPartial.cshtml