Skip to content

Scope the remaining Location relation filters to the caller's products - #16029

Open
svader0 wants to merge 1 commit into
DefectDojo:bugfixfrom
svader0:harden-location-outward-predicates
Open

svader0 wants to merge 1 commit into
DefectDojo:bugfixfrom
svader0:harden-location-outward-predicates

Conversation

@svader0

@svader0 svader0 commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Hardening and consistency improvement to the Location filters under the V3 Locations feature.

A Location row is deduplicated across every product that records the same value, so a filter that reaches outward from the row can be satisfied through a reference that belongs to a different product. #15760 taught one filterset to match against the requesting user's own references only, but it left that rewrite as a method on a single class. This moves it to a mixin and applies it to the remaining readers, plus two predicates that are applied outside a filterset.

Adds regression tests. No query parameter, response field or schema change, and no functional change for a product that is the only one recording the value.

A Location row is deduplicated across every product that records the same URL, so
a predicate that joins out of the row can be satisfied by a reference the caller
is not authorized for. Authorizing the result set afterwards is a separate
filter() call, which Django compiles to a second join, so the row still qualifies
through the caller's own reference while the match through another product's data
stays observable.

The existing rewrite that bounds those predicates was a method on one filterset
class. Move it to a mixin and apply it to the REST Location list filterset, then
bound the two remaining predicates that are applied outside a filterset: the
endpoint_status compatibility filter and the vulnerable-endpoint view body.

The subquery now applies the predicate and the product bound as two filter()
calls. As one kwargs dict they can spell the same lookup and silently drop one
of them, which is reachable from the list-valued product filters.

No query parameter, response field or schema change. For a non-privileged caller
the only behaviour that changes is that a predicate stops matching through
references they cannot see.

This branch has not been deployed

No deployments
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.

1 participant