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?
- Return only the fields the client needs and require authentication and authorisation on each endpoint
- Return the entire database record for every request
- Disable error logging
- 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.