Safeguard
Security Guides•

API10 unsafe consumption: treat third-party API data as untrusted

OWASP API10:2023 warns against trusting data from partner and vendor APIs. Learn the three failure patterns and the checks that prevent them.

Safeguard Security Team
3 min read

Data that comes back from a third-party API is input, and it should be validated like user input. OWASP API10:2023 describes teams that apply weaker validation, transport security and authentication to integrated services than to users, and attackers exploit that trust.

The core idea

Developers tend to trust a partner API because it is a business relationship, not an anonymous visitor. OWASP points out the result: weaker checks on that data, which can lead to sensitive data exposure, injection or denial of service, depending on what your code does with it. The page rates prevalence as common and technical impact as severe.

Three scenarios from OWASP

Poisoned enrichment data. An API enriches business addresses through a third-party service and stores the results in a SQL database. An attacker plants an injection payload in a business record at that service. When the target API pulls the record, the payload runs and leaks data.

Redirect abuse. An API sends sensitive medical records to a third-party service over HTTPS. The service is compromised and returns a redirect to an attacker's server. The API follows the redirect and resends the full payload there.

Malicious repository name. An attacker creates a repository with an injection payload in its name. An integrated application uses the name in a SQL query without treating it as untrusted.

What to do

OWASP's prevention advice is short and practical:

  • Assess the security posture of providers before integrating.
  • Use TLS for all interactions with them.
  • Validate and sanitize data from integrated APIs before using or passing it on.
  • Keep an allow-list of expected redirect destinations and do not follow redirects blindly.

Turning that into code habits

  1. Parse into a strict schema. Reject fields you did not expect and values outside range.
  2. Use parameterized queries for anything you store or look up, even when the value came from a vendor.
  3. Set size and time limits on responses so a bad upstream cannot exhaust memory.
  4. Disable automatic redirects in the client, or check each target against an allow-list. This is also the control for the sensitive payload scenario.
  5. Send the minimum. What you never send cannot be redirected.
  6. Do not give vendor responses privileges. A role or flag in a vendor field should never decide authorization.

Inventory the flows

OWASP's inventory guidance says to record integrated services, the data exchanged and its sensitivity. You cannot check what you do not know about. See what to record in an API inventory.

Quick check

Is TLS enough protection for vendor data?

No. TLS protects the channel. A compromised or malicious upstream can still send hostile content over a perfectly valid connection.

Does this apply to internal microservices?

The same reasoning holds. A service that trusts another service's output without validation inherits that service's compromise.

Safeguard's SBOM and dependency scanning cover the libraries you use to call vendors, and the free scan at gold.safeguard.sh/scan is an easy first step. Vendor data validation stays in your handlers.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.