🎄 Join our Annual Holiday wargame and win prizes!


Open Policy Injection

Open Policy Injection occurs when untrusted data is used as input in policy evaluations or rules within tools like Open Policy Agent (OPA) or Rego. An attacker can manipulate these inputs to inject malicious policies, bypass access controls, or expose sensitive information. This vulnerability arises when there is insufficient validation of the data used in policy logic, leading to potential information disclosure, privilege escalation, or other security breaches.

Remediation

  • Avoid allowing policies to be dynamically loaded or modified at runtime from untrusted sources.
  • Ensure all inputs to OPA policies or Rego rules are strictly validated against expected schemas and formats before being processed.
  • Apply sanitisation techniques to clean user inputs before including them in policy evaluations.

Metadata

  • Severity: medium
  • Slug: open-policy-injection

CWEs

  • 20: Improper Input Validation

OWASP

  • A03:2021: Injection

Available Labs

Select a language to explore available labs for this vulnerability.

No matching labs found

Try adjusting your language filter.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more