OGNL stricter-invocation block list bypass via java.lang.reflect reflection proxies
Summary
OGNL's optional stricter invocation mode maintains a block list that prevents expressions from directly calling methods on dangerous classes such as Runtime, ProcessBuilder, and ClassLoader. The block list filters on the declaring class of the method OGNL invokes. Because java.lang.reflect.Method (and Constructor/Field) are not on the list, an expression can use reflection as a proxy — someMethod.invoke(target, args) — to reach a blocked method. The real call (e.g. ProcessBuilder.start()) then executes inside the JDK reflection machinery and never passes back through OGNL's invokeMethod, so the block list never sees it.
Proof of concept
Under the default OGNL context (public-only access, stricter invocation enabled), the following expression creates a file even though a direct new ProcessBuilder(...).start() is blocked:
(#pb=new java.lang.ProcessBuilder({"/usr/bin/touch","rce-proof.txt"}),
#methods=@java.lang.ProcessBuilder@class.getMethods(),
#names=#methods.{ #this.getName() },
#startIdx=#names.indexOf("start"),
#methods[#startIdx].invoke(#pb, null))
Impact and scope — please read carefully
This is hardening of a defense-in-depth secondary layer, not a break of OGNL's primary security boundary.
In OGNL the stricter-invocation block list is a secondary mitigation. The primary access-control gate is the MemberAccess implementation supplied by the integrating framework or application, which OGNL consults on every constructor and method call. Frameworks that evaluate untrusted expressions are expected to install a restrictive MemberAccess — for example, Apache Struts' SecurityMemberAccess, which excludes dangerous classes and the java.lang.reflect package. Against such a MemberAccess this PoC is blocked at the very first step (the new ProcessBuilder(...) constructor), before reflection is ever reachable.
The default context that ships with OGNL intentionally allows all public members and is not designed to sandbox untrusted input. An application that evaluates attacker-controlled expressions with that permissive default already has many paths to code execution, and this technique is not required to achieve it.
You are affected only if all of the following hold: (1) your application evaluates untrusted/attacker-controlled OGNL expressions, (2) it uses OGNL's default permissive MemberAccess (or an equivalently permissive one that allows java.lang.reflect), and (3) it relies on the stricter-invocation block list as its sandbox. Properly configured consumers — including Apache Struts with its SecurityMemberAccess — are not affected. The actual protection for untrusted-expression scenarios remains a correctly configured MemberAccess; the block list should not be treated as a sandbox.
Fix
java.lang.reflect.Method, java.lang.reflect.Constructor, and java.lang.reflect.Field are added to the stricter-invocation block list, so reflection objects can no longer be used as invocation proxies in stricter mode. The java.lang.invoke.MethodHandle path was verified not to be exploitable (its signature-polymorphic invoke/invokeExact fail through OGNL's reflection-based invocation), so no additional classes are required.
Credit
Reported responsibly through Tidelift by 毛锐 (youyi.mr@alibaba-inc.com).
What to do
Upgrade OGNL to version 3.4.13 or later. Ensure that applications evaluating untrusted expressions implement a restrictive MemberAccess policy rather than relying on the stricter-invocation block list as a sandbox.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | ognl:ognl | < 3.4.13 | 3.4.13 |
References
- https://github.com/orphan-oss/ognl/security/advisories/GHSA-crwc-vw2r-qr6m
- https://nvd.nist.gov/vuln/detail/CVE-2026-113730
- https://github.com/orphan-oss/ognl/commit/16396fa4b560221294c2ab9ca04b76b161115e7d
- https://github.com/orphan-oss/ognl/commit/f4c17f794754d516ea799c36ed8524d1b7fb98e2
- https://github.com/orphan-oss/ognl
- https://github.com/orphan-oss/ognl/releases/tag/OGNL_3_4_13
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L- Weakness (CWE)
CWE-693- Platform
- Java / Kotlin (Maven)
- Package
ognl:ognl- Disclosed
- 21.10.2026
- Updated
- 21.10.2026 19:26
Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.
OSV / GitHub Advisory Database - GHSA-crwc-vw2r-qr6m - CC BY 4.0
Vulnerability history: ognl:ognl
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 2
- First → latest
- 05.2022 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Medium 2
Disclosures per year
- 2022: 1
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 1
-
OGNL stricter-invocation block list bypass via java.lang.reflect reflection proxies this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.