Skip to content

security(spp_api_v2_programs): POST /ProgramMembership "Beneficiary not found: <ref>" 422 reveals registrant existence [Severity: Low] #560

Open

Description

@gonzalesedwin1123

Problem

ProgramMembershipService.from_api_schema() raises ValidationError("Beneficiary not found: <reference>")
(spp_api_v2_programs/services/program_membership_service.py, ~312), which the create/update routers return as 422.
A client holding program_membership:create but requiring consent can tell whether a registrant exists (422 "not
found" vs a created or otherwise-refused membership), which the read endpoints avoid by answering 403.

Proposal

For consent-requiring clients, answer an unknown beneficiary the same way as a beneficiary the client may not access
(403, jittered), and cover it with a test. Note that create-with-existing-identifier 409s (PR #555) are an accepted,
documented existence signal for create-scope clients; this issue is about the beneficiary reference on membership
create/update.

Context

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

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