Skip to content

Group export and SQL on FHIR filters read Group and Patient without checking read authority #2987

Backlog

Description

@johngrimes

GroupMemberService.extractPatientIdsFromGroup reads the Group table and returns the members of a group, or throws ResourceNotFoundException if the group does not exist (server/src/main/java/au/csiro/pathling/operations/compartment/GroupMemberService.java:65-70). Neither it nor its callers check pathling:read:Group. The callers are the group-level export (server/src/main/java/au/csiro/pathling/operations/bulkexport/GroupExportProvider.java:139) and the group filter of the SQL on FHIR operations (server/src/main/java/au/csiro/pathling/operations/sql/SqlFilterResolver.java:167). The patient filter similarly checks that each patient exists without checking pathling:read:Patient (SqlFilterResolver.java:129-136).

Reproduced on a build of release/server/3.2.0 (f70763af29) with authorisation enabled, for the export path. The token had pathling:export and pathling:read:Patient only:

Request Result
GET /fhir/Group/g1 403
GET /fhir/Group/g1/$export?_type=Patient 202, and the output contained only the Patient that is a member of g1
GET /fhir/Group/nope/$export?_type=Patient 404, "Group/nope"

A caller without read access to Group can therefore learn which groups exist and who their members are. The SQL filter paths were not tested.

Suggested change: check pathling:read:Group before a group is resolved, and pathling:read:Patient before the existence check in the patient filter.

Acceptance: the second and third requests in the table return 403 for a caller without pathling:read:Group, covered by tests for the export provider and SqlFilterResolver.

Activity

  1. added
    security
    server
    on Nov 25, 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

    securityserver

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions