Slide 18 of 28
Part 4 · PreventionSlide 18
PART 4
Prevention
Slides 18–26 · Seven mitigations
Slide 18 · Seven Mitigations Overview
Seven controls that treat third-party data with the same discipline as user input.
Each mitigation closes a different gap in the implicit trust model.
🚫
MIT 01 · Treat third-party responses as untrusted input
Apply the same validation, sanitization, and security controls to third-party API responses as you apply to user-submitted data. No exceptions based on source reputation.
MIT 02 · Validate and sanitize all third-party response fields
Validate type, length, and format. Parameterize SQL. Escape HTML. Strip dangerous patterns before logging. Applied at the point of use, not at the integration boundary.
➡️
MIT 03 · Allowlist outbound URLs — never follow arbitrary redirects
Any URL fetched server-side — including URLs from third-party responses — must be validated against an allowlist. Validate the destination of redirects, not just the source. Disable redirect following where not needed.
🔍
MIT 04 · Security due diligence before integration
Evaluate a third-party vendor’s security posture before integrating. Review their security practices, incident history, and data handling. Prefer vendors who publish SOC 2 Type II reports or equivalent attestations.
📱
MIT 05 · Subresource Integrity for third-party scripts
For CDN-hosted scripts loaded in HTML, use the integrity attribute with a cryptographic hash. The browser refuses to execute the script if the hash doesn’t match. This prevents CDN compromise from delivering modified scripts.
🔑
MIT 06 · Minimum-privilege third-party integrations
Scope third-party API permissions to exactly what’s needed. Don’t grant write access if only read is needed. Use separate API keys per integration. Rotate keys regularly. Revoke immediately on vendor incident.
📦
MIT 07 · Isolate third-party integration points
Run third-party integrations in isolated services or sandboxed environments with minimal permissions. A compromised third-party response processed by an isolated adapter cannot affect the core API or database directly.
← Back MIT 01: Treat responses as untrusted →