Skip to content

f:query policy conditions may read the default graph instead of the judged fact's graph #2289

Open

Description

@bplatz

QueryPolicyEnforcer::filter_flakes_for_graph and allow_flake_for_graph (fluree-db-query/src/policy/enforcer.rs) build the f:query condition executor with QueryPolicyExecutor::with_overlay(snapshot, overlay, to_t), which reads graph 0. The g_id of the fact being judged is not passed in. A policy condition judging a fact in a named graph may therefore read the default graph instead of the fact's own graph.

Found by code reading while scoping policy-restricted reasoning serving; not yet reproduced. It was left out of that work because the fix changes shared policy semantics, and does not apply only to reasoning.

Proposed:

  1. Reproduce: the same subject in two named graphs, with an f:query condition answering opposite ways in each.
  2. If confirmed, pass the graph through to the executor and test it through batch filtering, single-fact checks and path checks, with and without query-time reasoning.

Activity

  1. added
    bug
    P2
    triage:needs-info
    area:query
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:querybugtriage:needs-info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions