GHSA-crwc-vw2r-qr6m

Suggest an improvement
Source
https://github.com/advisories/GHSA-crwc-vw2r-qr6m
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-crwc-vw2r-qr6m/GHSA-crwc-vw2r-qr6m.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-crwc-vw2r-qr6m
Aliases
Published
2026-10-21T16:31:04Z
Modified
2026-10-21T16:45:04Z
Severity
  • 5.6 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
Summary
OGNL stricter-invocation block list bypass via java.lang.reflect reflection proxies
Details

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).

Database specific
{
    "cwe_ids":  [
        "CWE-693"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-10-21T16:31:04Z",
    "nvd_published_at":  "2026-10-20T22:19:30Z",
    "severity":  "MODERATE"
}
References

Affected packages

Maven / ognl:ognl

Package

Name
ognl:ognl
View open source insights on deps.dev
Purl
pkg:maven/ognl/ognl

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.4.13

Affected versions

2.*
2.1.4
2.2.2
2.3.2
2.4.1
2.5.1
2.6.3
2.6.5
2.6.7
2.6.9
2.7
2.7.1
2.7.2
2.7.3
3.*
3.0
3.0.1
3.0.2
3.0.3
3.0.4
3.0.5
3.0.6
3.0.6.1
3.0.6.2
3.0.7
3.0.8
3.0.9
3.0.10
3.0.11
3.0.12
3.0.13
3.0.14
3.0.15
3.0.16
3.0.17
3.0.18
3.0.19
3.0.20
3.0.21
3.1
3.1.1
3.1.2
3.1.3
3.1.4
3.1.5
3.1.6
3.1.7
3.1.8
3.1.9
3.1.10
3.1.11
3.1.12
3.1.14
3.1.15
3.1.16
3.1.17
3.1.18
3.1.19
3.1.20
3.1.21
3.1.22
3.1.23
3.1.24
3.1.25
3.1.26
3.1.27
3.1.28
3.1.29
3.2
3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.2.6
3.2.7
3.2.8
3.2.9
3.2.10
3.2.11
3.2.12
3.2.13
3.2.14
3.2.15
3.2.16
3.2.17
3.2.18
3.2.19
3.2.20
3.2.21
3.3.0
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.4.0
3.4.1
3.4.2
3.4.3
3.4.4
3.4.5
3.4.6
3.4.7
3.4.8
3.4.9
3.4.10
3.4.11
3.4.12

Database specific

last_known_affected_version_range
"<= 3.4.12"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-crwc-vw2r-qr6m/GHSA-crwc-vw2r-qr6m.json"