Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-27207

Map with linked submap throws PHP notices when viewer is denied access to host groups used in the submap

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 7.0.21
    • Frontend (F)
    • None
    • Zabbix front end: 7.0.19 LTS
      Zabbix server: 7.0.19 (not required to reproduce)
      Web server: Apache/Nginx Nginx
      PHP: 8.3
      DB: Postgresql 16

      Steps to reproduce

      Changes in configuration…

      1. Create two host groups:
      • HG_Allowed
      • HG_Denied
      1. Create one host in each group (any simple item is fine):
      • host_allowed in HG_Allowed
      • host_denied in HG_Denied
      1. Create two maps:
      • Map_B (submap): add a host/trigger/selement that references host_denied (and/or any element tied to HG_Denied).
      • Map_A (parent): add a Map element that links to Map_B.
      1. Permissions / roles:
      • Create a role that allows viewing Monitoring → Maps.
      • Create a user group UG_Test and grant it Read to HG_Allowed and Deny (or no permission) to HG_Denied.
      • Create a user user_test, assign it to UG_Test. Ensure user_test can open Maps but has no access to HG_Denied.

      Navigate to screen title…
      5) Log in as user_test and go to Monitoring → Maps → Map_A.

      Click on screen element…
      6) Open Map_A so the front end resolves its elements (including the linked Map_B that contains objects from HG_Denied).


      Result

      • The map view either partially renders or appears broken.
      • PHP notices are emitted (web server/PHP error log) when resolving map elements:

        * The numeric keys correspond to element/host IDs that belong to objects user_test is not allowed to see (from HG_Denied).


      Expected

      • Map_A should render without PHP notices.
      • Linked Map_B should be handled gracefully when it contains objects the viewer can’t access:
        • Either omit those elements, or replace them with a generic “no permission” placeholder/badge.
        • Parent map should still load and be usable.
      • No “Undefined array key / Trying to access array offset on null” notices in include/maps.inc.php during getSelementsInfo() / resolveMapState().

      Notes / scope

      • Reproduces consistently with any linked submap containing elements from a denied host group.
      • Seems front-end specific (map element resolution). Zabbix server component not required to trigger.
      • Clearing browser cache and Zabbix frontend cache does not affect reproduction.
      • Occurs regardless of whether the submap is clicked; the error appears on render when resolving its elements.

      Workarounds

      • Temporarily grant Read permission to the denied host group(s) for the affected viewers, or
      • Remove/relocate the denied elements from the linked submap, or
      • Replace the linked submap with a version that contains only elements the viewer can read.

            Unassigned Unassigned
            VF-ericg Eric Goertzen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: