Why it matters

Developers often trust data from third-party APIs more than user input, so a compromised or malicious provider can inject data, redirect requests or exhaust resources.

How to prevent it

  • Validate and sanitize data from third-party APIs as you would user input.
  • Use TLS for every integration, and do not follow redirects blindly.
  • Set timeouts and size limits on responses, and assess providers’ security before integrating.

Guides on this site

Practice

References

  1. API10:2023 Unsafe Consumption of APIs (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.