Object-Graph Navigation Language, or OGNL, is a Java expression language used to read and write object properties and call methods at runtime. In web applications, untrusted OGNL input can lead to expression injection, letting an attacker reach sensitive methods or alter application state if the input is evaluated without strict whitelisting.
How OGNL behaves in web applications
OGNL is an expression language, so the core security question is not the syntax itself but who controls the expression text and what objects are reachable at runtime. In a typical Java web application, OGNL can read properties, call methods and traverse object graphs, which makes it powerful for templating and framework integration but dangerous if untrusted input reaches the evaluator.
The practical boundary is whether the application treats OGNL as trusted code or as user-supplied data. Once that boundary is lost, the language can become an execution path into application internals rather than a harmless formatting tool.
Why OGNL injection is dangerous
OGNL injection matters because expression evaluation can cross from data access into behaviour change. If an attacker can influence an OGNL expression, they may be able to invoke sensitive methods, inspect internal state, or modify objects that the application assumed were protected by normal request handling.
This is especially risky in frameworks that evaluate expressions during parameter binding, view rendering, or action processing. The danger is not only remote code execution in the narrow sense, but also integrity loss, unauthorized method access, and application-state manipulation that can cascade into broader compromise.
For a defensive lens on the kinds of techniques that often accompany expression injection and post-exploitation activity, see MITRE ATT&CK Enterprise Matrix, which helps map follow-on actions such as privilege escalation and credential access.
Common exposure points and how organisations assess them
Exposure usually appears where an application accepts free-form expression content, reflects user input into framework features, or relies on unsafe defaults in older libraries and framework integrations. Asset inventory matters here because teams must know which applications, libraries and deployment paths can evaluate OGNL at runtime.
Assessment is strongest when teams combine source code review, dependency review, and runtime testing of request paths that might reach expression evaluators. Vendor advisories and framework security guidance remain the authoritative source for version-specific exposure, while security teams should also verify whether the application is internet-facing or reachable through a chain of trusted internal components.
From a broader control perspective, NIST SP 800-53 Rev 5 Security and Privacy Controls provides a useful control vocabulary for access control, configuration management and auditability around dangerous runtime features. ISO/IEC 27001:2022 Information Security Management is also relevant when organisations need governance over secure configuration, privileged access and change control for application platforms.
Safer design, detection and post-exploitation review
The safest pattern is to avoid evaluating untrusted OGNL altogether, or to constrain it with strict allowlists and context-limited expressions. Where that is not possible, teams should reduce the reachable object surface, prevent dangerous method exposure, and treat expression evaluation as a high-risk capability that must be monitored.
Detection should focus on anomalous requests that include expression syntax, unexpected method names, or payloads that alter application behaviour rather than merely returning data. After suspected exploitation, review logs, request traces, server-side error output and any downstream state changes to determine whether the attacker moved beyond initial evaluation into persistence or secondary abuse.
For defensive countermeasure patterns that complement detection and hardening, MITRE D3FEND is a useful reference for mapping protections to adversary techniques. If the application exposes APIs that also process user-controlled parameters, OWASP API Security Top 10 helps teams consider how authorization failures or unsafe input handling can compound the impact of injection.
Risk and Threat Considerations
OGNL becomes a security issue when user-controlled expressions are evaluated in a trusted application context. The main risk is that a seemingly narrow injection flaw can turn into arbitrary object access, unauthorized method invocation, state corruption or broader application compromise.
Failure mechanism: The application accepts OGNL from an untrusted source, evaluates it without strict allowlisting, and exposes internal objects or methods that the attacker can repurpose for malicious action.
Impact: The result can include data exposure, privilege abuse, integrity loss, session tampering, or a foothold for further exploitation inside the web application.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack surface, NIST SP 800-53 Rev 5 and OWASP ASVS set the technical controls, and ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1059 — Command and Scripting Interpreter | OGNL injection can drive runtime method execution and hostile command-like behavior. |
| Recommendation — Map expression-injection abuse paths to T1059 and monitor for unexpected interpreter-like execution. | ||
| NIST SP 800-53 Rev 5 | AC-6 — Least Privilege | Limiting reachable objects and methods reduces what injected OGNL can alter or access. |
| AU-2 — Event Logging | OGNL abuse is best detected through logging of unusual requests and runtime evaluation events. | |
| Recommendation — Apply AC-6 to restrict application components to only the methods and objects they truly need. Implement AU-2 logging for expression evaluation and anomalous request patterns. | ||
| ISO/IEC 27001:2022 | A.8.9 — Configuration management | Secure defaults and controlled configuration are central to preventing unsafe OGNL evaluation. |
| Recommendation — Enforce A.8.9 to harden application configuration and remove unsafe expression-evaluation defaults. | ||
| OWASP ASVS | V15 — Secure Coding and Architecture | ASVS addresses insecure dynamic behavior and unsafe use of evaluators in application design. |
| Recommendation — Use V15 to eliminate unsafe dynamic evaluation paths from application architecture. | ||
Practitioner Guidance
What to watch for: Treat any feature that evaluates expressions, templates or dynamic property paths as a security-critical code path. Review it with the same discipline you would apply to deserialisation or command execution, because the practical failure mode is similar: attacker-controlled input being interpreted as executable logic.
Practitioner takeaway: If OGNL must remain in use, the default assumption should be that every untrusted expression is hostile until it has passed a narrowly defined allowlist and a review of the exact objects it can reach.
Related resources from NHI Mgmt Group
- How do you patch or mitigate CVE-2021-26084 (Atlassian Confluence Server and Data Center Object-Graph Navigation Language (OGNL) Injection)?
- Is CVE-2021-26084 (Atlassian Confluence Server and Data Center Object-Graph Navigation Language (OGNL) Injection) being exploited in the wild?
- CVE-2021-26084 (Atlassian Confluence Server and Data Center Object-Graph Navigation Language (OGNL) Injection)
- Object-Graph Navigation Language Injection
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 18, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org