TK Study

Multiple choice › Safe API design

Safe API design

1. Safe API design

Which is the BEST way to reduce the risk of an API exposing more data than intended?

  1. Return only the fields the client needs and require authentication and authorisation on each endpoint
  2. Return the entire database record for every request
  3. Disable error logging
  4. Allow unlimited anonymous requests
Answer

A

Excessive data exposure and weak access control are common API vulnerabilities (cf. 2025 HSC Q5). Also use rate limiting and validate input.