[BUG] Application role restrictions are ignored when using "Treat Tags As: Categories"
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- authorization, backend
Hướng nghiên cứu
Bắt đầu trong ItemController::dash() tại app/Http/Controllers/ItemController.php và so sánh nhánh categories với nhánh folders, nhánh này đã lọc bằng whereIn('role', $roles). Thêm cùng ràng buộc role bên trong closure with('children', ...) cùng với pinned(), và kiểm tra cách $roles được parse khi thiếu header để các mục không bị giới hạn không bị ẩn. Hoàn tất nghĩa là một người dùng có header chỉ chứa staff chỉ thấy tile staff bên trong category; tái hiện với header remote-groups được mô tả ở trên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When role-based authorization is enabled using AUTH_ROLES_ENABLE=true, Heimdall correctly supports assigning roles to individual application tiles.
However, when Treat Tags As is set to Categories, the configured application-level role restrictions are not enforced.
Applications assigned to a tag become visible on the dashboard regardless of whether the authenticated user belongs to the required group.
This appears to be a regression in authorization behavior depending on the selected dashboard layout.
Tags are only used to organize applications into categories. Assigning an application to a tag should not affect its existing role restrictions.
Environment
Deployment: Docker
Docker image: LinuxServer.io Heimdall
Image tag:
latest(exact image reference to be confirmed)Application version: To be confirmed from the running container
Source code analyzed: Heimdall v2.8.4
Authentication: External authentication with group information forwarded through HTTP headers
Role header:
remote-groupsRole-based authorization: Enabled
Treat Tags As:
Categories
Relevant example configuration:
AUTH_ROLES_ENABLE=true
AUTH_ROLES_HEADER=remote-groups
AUTH_ROLES_ADMIN=admin
The configuration and identifiers below illustrate a minimal reproduction scenario and do not contain production credentials or actual user information.
Minimal reproduction setup
Users and groups
Two regular users are provided by an external authentication system.
User A: Alice
Username: alice
remote-groups: staffUser B: Bob
Username: bob
remote-groups: operationsNeither user has the admin role.
Applications
Create two applications with different role restrictions:
| Application | Assigned role | Pinned |
|---|---|---|
| Internal Wiki | staff | Yes |
| Infrastructure Monitoring | operations | Yes |
Assign both applications to this tag.
Configure Heimdall to display tags as categories:
Settings → Treat Tags As → Categories
The tag is intended exclusively for organizing applications on the dashboard. It should not override or replace the roles assigned to individual applications.
Steps to reproduce
Start Heimdall with role-based authorization enabled.
Configure an external authentication system to forward the authenticated user's group memberships through the
remote-groupsheader.Create two application tiles:
Internal Wiki, restricted tostaff.Infrastructure Monitoring, restricted tooperations.
Ensure both applications are pinned.
Create a tag named
Infrastructureand pin it.Assign both application tiles to the
Infrastructuretag.Set
Treat Tags AstoCategories.Open Heimdall as a regular user whose
remote-groupsheader contains onlystaff.Inspect the applications displayed under the
Infrastructurecategory.
Expected behavior
The authenticated user's group memberships should determine which application tiles are visible, independently of the dashboard layout.
For Alice (remote-groups: staff), the dashboard should display:
Infrastructure
└── Internal WikiInfrastructure Monitoring must not be displayed because Alice does not have the operations role.
For Bob (remote-groups: operations), the dashboard should display:
Infrastructure
└── Infrastructure MonitoringInternal Wiki must not be displayed because Bob does not have the staff role.
The category should only organize applications that the current user is permitted to see.
Actual behavior
Both applications are displayed under the Infrastructure category, regardless of the authenticated user's group memberships.
For Alice, the dashboard incorrectly displays:
Infrastructure
├── Internal Wiki
└── Infrastructure Monitoring <-- UnexpectedFor Bob, it incorrectly displays:
Infrastructure
├── Internal Wiki <-- Unexpected
└── Infrastructure MonitoringApplication-level role restrictions are therefore not enforced when applications are rendered within categories.
Additionally, assigning a non-matching role to the tag itself does not prevent the applications from appearing.
For example, assigning the tag the role restricted-test-group, which neither user possesses, does not resolve the problem.
The issue is not that tags lack additional authorization capabilities. The issue is that existing application-level restrictions are ignored.
Technical analysis
The behavior appears to originate in:
app/Http/Controllers/ItemController.php
Specifically, within ItemController::dash().
In Heimdall v2.8.4, the relevant code in the role-enabled branch is:
$roles = explode( config('app.auth_roles_delimiter'), $request->header(config('app.auth_roles_header')) ?? '' );
if ($treat_tags_as == 'categories') {
$data['categories'] = Item::whereHas('children')
->with('children', function ($query) {
$query->pinned()->orderBy('order', 'asc');
})
->pinned()
->orderBy('order', 'asc')
->get();
}
The authenticated user's roles are extracted into $roles, but they are not used in the query that retrieves the category's child applications.
The eager-loaded children relationship only applies the pinned scope and ordering.
Consequently, applications are retrieved without checking whether their assigned roles match the current user's roles.
In contrast, the Folders branch of the same controller contains an application role filter:
->whereIn('role', $roles)This suggests that role filtering was omitted from the category-specific query.
Source:
https://github.com/linuxserver/Heimdall/blob/v2.8.4/app/Http/Controllers/ItemController.php
Impact
This issue causes unintended disclosure of application tiles to users who do not possess the required roles.
Potentially exposed information includes:
Application names
Application URLs
Application icons
The existence of internal services
Service organization and category membership
It also makes dashboard visibility restrictions dependent on the selected presentation mode.
An administrator may configure application roles correctly while being unaware that switching to the Categories layout effectively disables those visibility restrictions.
This report does not claim that authentication or authorization in the linked applications can be bypassed. The observed issue concerns the visibility of application entries within Heimdall.
Suggested resolution
Ensure that application-level role restrictions are applied when loading applications belonging to categories.
The existing authorization behavior should remain consistent across dashboard presentation modes.
Specifically:
Retrieve the authenticated user's roles using the existing role-header mechanism.
Apply the existing application role restrictions to applications loaded through category relationships.
Ensure that unauthorized applications are not included in the rendered category contents.
Preserve the use of tags as organizational elements without introducing mandatory tag-level authorization.
This report does not request additional permissions on tags or role inheritance from categories to applications.
It only requests that the existing application-level restrictions continue to be enforced when the dashboard is displayed using categories.
Additional information
The problem is reproducible with applications assigned to the same category but restricted to different groups.
Changing the tag's own role does not resolve the unauthorized visibility of its applications.
The relevant distinction is between:
Application role: Determines whether the user should see the application.
Tag/category: Determines where the application is displayed.
A presentation setting should not disable an existing visibility restriction.
The expected outcome is that users continue to see only applications matching their assigned roles, regardless of how those applications are organized on the dashboard.
- Ngôn ngữ chính
- PHP
- Star
- 9.4k
- Fork
- 626
- Merge trung bình
- 13 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của linuxserver/Heimdall
-
Font Awesome SVGs eat clicks meant for their parent buttons (I could be misjudging the issue)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
linuxserver/Heimdall#1625 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 53/100
linuxserver/Heimdall#1624 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
linuxserver/Heimdall#1613 ·
-
no-issue-activity
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
linuxserver/Heimdall#1601 · 1 bình luận · 4 reaction ·
-
no-issue-activity
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
linuxserver/Heimdall#1588 · 4 bình luận ·
Tất cả issue của linuxserver/Heimdall
Issue tương tự
-
Activity page icons previewĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Automattic/static-site-importer#3129 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Group 2 - Data Storage | Tripal DBX | Chado Group 5 - Search | ElasticSearch | Views Priority - Medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
category::bug code priority::normal
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
e0ipso/simple_oauth_21#58 ·
Maintainer thường phản hồi trong vòng 1 ngày