FM-044 Security and Identity

Sensitive Data Exposure in API Responses

Responses include internal identifiers, authentication metadata, or admin-only fields that the caller is not authorized to see.

Failure explanation

An API returns more information than the caller needs or is authorized to receive. Sensitive fields may leak through normal resource responses, nested objects, list endpoints, exports, debug metadata, or error bodies. A schema that is shared across roles can accidentally expose internal notes, personal information, tokens, or administrative fields.

Example

GET /customers/123 returns a complete database model including passwordResetToken, internal risk flags, and support-only notes, even though the customer should see only their profile details.

How to test

  • Define expected response fields for each role and endpoint.
  • Inspect nested objects, list responses, exports, error messages, and debug headers.
  • Use synthetic sensitive markers to detect accidental exposure.
  • Verify redaction and field-level authorization.

Expected behavior

Responses contain only data appropriate for the caller and purpose. Sensitive values are excluded or explicitly authorized, and errors do not leak internal implementation details.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.