Fix it in your stack

Tested fixes for the weaknesses API3:2023 maps, in Express, Flask, Spring Boot, ASP.NET Core, Next.js, FastAPI, Django, net/http, Rails and Laravel: the vulnerable code, the fix, a wrong fix and the regression tests.

Why it matters

Returning whole objects leaks fields the caller should not see, and binding whole request bodies lets callers change fields they should not. The 2023 edition combines excessive data exposure and mass assignment.

How to prevent it

  • Return only the fields each caller may read, using explicit response schemas.
  • Accept only the fields each caller may write, and never bind request bodies directly to data models.
  • Check requests and responses against those schemas in tests.

Guides on this site

Practice

References

  1. API3:2023 Broken Object Property Level Authorization (OWASP)

List data from the publisher. A guide is listed as the main subject when the weakness or risk is what the guide is about, and as covering it when a dedicated section or worked example addresses it.