Script object variables display and accept objects the user cannot view
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- authentication, backend-api-design
Hướng nghiên cứu
Start by tracing the UI and REST run paths that render and validate Script forms, then inspect how ObjectVar and MultiObjectVar resolve submitted IDs. Check where NetBox's restrict_form_fields() helper is applied and how object-level view permissions affect its queryset. Done means inaccessible objects are neither shown as selected values nor accepted on submission, including REST requests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Plugin Version
v0.0.1
NetBox Version
v4.7.4
Python Version
3.12
Steps to Reproduce
- As an administrator, upload and activate this Script:
from ipam.models import Prefix from netbox_scripts import ObjectVar, Script class InspectPrefix(Script): prefix = ObjectVar(model=Prefix) def run(self, data, commit): self.log_info(str(data['prefix']), obj=data['prefix']) - Create a prefix, such as
10.0.0.0/24, and note its ID. - Sign in as a non-superuser with
runpermission on the Script and no view permission for prefixes, either directly or through a group. - Open
/plugins/netbox-scripts/scripts/<script-id>/run/?prefix=<prefix-id>. - Submit the form.
Expected Behavior
ObjectVar and MultiObjectVar display and accept only objects the requesting user can view, including any object-level permission constraints.
The prefix is not displayed as a selected value. Submitting its ID through the UI or REST API returns an invalid-choice error without creating a Job.
Observed Behavior
The Run page displays 10.0.0.0/24 as the selected prefix. Submitting the form creates a Job with that Prefix object in data, despite the user's lack of view permission.
Dropdown searches and the advanced selector respect view permissions, but prefilled and submitted IDs are resolved against an unrestricted queryset. MultiObjectVar and REST submissions are affected too.
The UI and REST run paths do not apply NetBox's restrict_form_fields() helper before rendering or validating the form. The label is exposed before the Script runs, so permission checks inside run() cannot prevent it.
- Ngôn ngữ chính
- Python
- Star
- 8
- Fork
- 0
- Merge trung bình
- 9 giờ 34 phút
- Pull request đã merge (30 ngày)
- 32
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 netbox-community/netbox-scripts
-
app: scripts status: backlog type: documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
netbox-community/netbox-scripts#80 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Failed REST uploads expose internal error detailsCó thể đã có người làm @pheus đã nhận 1 ngày trước. Đang mởapp: scripts severity: medium status: accepted type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
netbox-community/netbox-scripts#77 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app: scripts severity: low status: backlog type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
netbox-community/netbox-scripts#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app: scripts severity: low status: backlog type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
netbox-community/netbox-scripts#74 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Correct the release checklist's tag and publishing stepsCó thể đã có người làm @pheus đã nhận 6 ngày trước. Đang mởapp: scripts status: accepted type: documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
netbox-community/netbox-scripts#68 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của netbox-community/netbox-scripts
Issue tương tự
-
bug severity:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
githubnext/gh-aw-workshop#5367 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scopeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Create Noise Latents ignores randomize_seed and produces the same noise every runCó thể đã có người làm @griptapeops đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Jenkins capacity report: metrics history is lost when archiving a month failsCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
adoptium/infrastructure#4568 ·
Maintainer thường phản hồi trong vòng 1 ngày