Back to Developer Roadmap

Avoid Returning Sensitive Data

src/data/best-practices/api-security/content/avoid-sensitive-data.md

4.0698 B
Original Source

Avoid Returning Sensitive Data

Only return the data that is needed for the client to function.

Returning only the data that is needed for the client to function is an important best practice for API security. This is because limiting the amount of data that is returned reduces the amount of sensitive information that is exposed. By only returning the necessary data, you can help prevent security vulnerabilities such as data leakage, injection attacks, and other types of attacks that rely on exposing too much information. Additionally, reducing the amount of data returned can improve the performance of your API by reducing the amount of data that needs to be processed and transmitted.