Skip to content

Scope endpoint and host view findings to the requesting user - #15441

Merged
Maffooch merged 3 commits into
DefectDojo:bugfixfrom
svader0:harden-endpoint-view-finding-scoping
Jul 31, 2026
Merged

Scope endpoint and host view findings to the requesting user#15441
Maffooch merged 3 commits into
DefectDojo:bugfixfrom
svader0:harden-endpoint-view-finding-scoping

Conversation

@svader0

@svader0 svader0 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Hardening / consistency improvement to the endpoint and host views. Reduces a finding queryset to the requesting user's authorized scope, matching the check the equivalent paths already apply, and adds a regression test.

No functional change for correctly-permissioned users: superusers and in-scope members see exactly what they saw before, in the same order.

The new test only exercises the Locations code path, so it needs a CI run with that feature enabled.

The endpoint and host views built their finding queryset from all findings and
narrowed it only by Location. A Location is shared by every product that
references it, so that queryset was wider than the caller's authorized scope.
Reduce it through get_authorized_findings_for_queryset, matching the check the
report and API paths already apply, and add a regression test.

No functional change for correctly-permissioned users.
svader0 added 2 commits July 30, 2026 18:16
Set the finding reporter explicitly instead of relying on the model default
pointing at an existing user, and grant product access through
authorized_users as well as Product_Member so the fixture is authorized
under both authorization implementations.
@Maffooch Maffooch added this to the 3.2.0 milestone Jul 31, 2026
@Maffooch
Maffooch merged commit 321ba82 into DefectDojo:bugfix Jul 31, 2026
149 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants