Skip to content

security(spp_api_v2): consent is not enforced on write paths — ConsentService.check_access only checks consent for read/search [Severity: Medium] #558

Open

Description

@gonzalesedwin1123

Problem

ConsentService.check_access() (spp_api_v2/services/consent_service.py, ~450) evaluates consent only when
action in ("read", "search"). For update/delete it checks scope and returns True. So the write endpoints that
use it (check_individual_access / check_group_access in routers/dependencies.py, and the group router's
update/merge checks) never evaluate consent:

A client configured with is_require_consent and write scopes can modify registrants it has no consent for, while
it cannot read them.

Expected

Decide the policy (consent required to process/modify, per docs/principles/consent-data-sharing.md), then enforce it
on every write path with the same predicate reads use (filter_response statuses no_consent / scope_mismatch),
with tests for a consent-requiring client without consent on each write endpoint.

Context

Found in the adversarial review of PR #555 (#554); pre-existing, not introduced there.

Activity

  1. gonzalesedwin1123 commented on Sep 29, 2026

    @gonzalesedwin1123
    MemberAuthor

    Note from the #555 review round: the write paths also leak existence, not only consent.

    On $add-member and the other member operations, a member individual that doesn't exist gets a plain 404, while one that exists but has no consent goes through. A consent-filtered client can therefore probe whether a registrant exists by referencing it as a member.

    After #555 the read and not-found paths all use one predicate, ConsentService.is_consent_filtered(api_client). The fix here should reuse it, so an unknown member and an unconsented member get the same answer (the jittered 403 that reads give).

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions