Returning 403 confirms the resource exists, which lets an attacker enumerate ids (for example other customers' order numbers). Returning 404 hides existence, the safer default for customer-owned data and in line with Privacy Act obligations. Implement it in the authorisation layer: resource-based authorisation (IAuthorizationService with a requirement checking ownership, plus scopes or claims from the JWT) or queries filtered by the caller's customer id, so another customer's record simply isn't found. The trade-off is usability: legitimate users and support staff get a less helpful error, so log the real reason server-side with the trace id and return that trace id in the ProblemDetails body. Keep 403 where existence isn't secret, such as a missing scope on an admin endpoint.
Checks awareness of resource enumeration and information leakage
Last updated 23 Nov 2026.