A data flow represents how data moves between application components, users, databases, and external systems. Common flows include requests, responses, database-to-application transfers, and third-party API exchanges. section 3.3
Treat every flow as untrusted. Malformed, invalid, or malicious data can create integration failures, cascading errors, or code injection. Third-party responses deserve the same validation as user requests because a compromised provider can transmit harmful data into the application. section 3.3
Use a data-flow view to ask practical security questions:
- Where does each payload originate, and which services, databases, or users receive it? section 3.3
- Are constraints enforced when data enters the system and again when responses arrive from other services? section 3.3
- Can the flow be represented in a threat-modeling tool and reviewed for attacker-controlled paths? section 2.2.2
Third-party profile data
A website imports profile details from an external identity provider during registration. If an attacker stored malicious code there, the website could ingest it and execute it against its database. Validate the provider’s response before using or storing it. section 3.3
Figure 3.14 Modern applications consist of complex data flows, such as the request flow, the response flow, and the third-party API flow.
Trace request, response, and third-party API paths together as one application data-flow map. section 3.3

