Application securityHigh severity

SECURITY GUIDE

Injection flaws

Understand how untrusted input can affect the way an application processes data, and how to reduce that risk.

Areas to considerWeb applicationsAPIsData access layers
01

THE CONTEXT

What to understand

Injection flaws occur when an application combines untrusted input with commands or queries without preserving the boundary between data and instructions. The specific impact depends on the component receiving the input and the permissions available to the application.

02

HIGH-LEVEL CONCEPT

How the risk can develop

This is a conceptual overview, not a procedure for reproducing an attack.

  1. Untrusted data reaches an application component.
  2. A trust-boundary control does not preserve the separation between data and instructions.
  3. A downstream component processes the input in an unintended way.
03

WHY IT MATTERS

Potential impact

Potential outcomes include unauthorized data access, unintended changes, service disruption, or exposure of information handled by the affected component.

04

BE AWARE

Signals to monitor

  • Unexpected input patterns or validation failures appearing repeatedly in application telemetry.
  • Database or application errors that correlate with unusual request parameters.
  • Access patterns that do not match normal application workflows.
05

PUT DEFENSE FIRST

Recommended defenses

  1. 01Use parameterized queries and safe, framework-provided data access APIs.
  2. 02Validate input against explicit allowlists and expected formats at trust boundaries.
  3. 03Run application components with only the permissions they require.
  4. 04Log relevant security events without recording secrets or sensitive user data, and review anomalous patterns.