GHSA-crwc-vw2r-qr6m: Medium severity maven/ognl:ognl vulnerability

Published Oct 21, 2026
·
Updated

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

Affected Software

1 affected componentFixes available
maven/ognl:ognl<=3.4.12
3.4.13

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/ognl:ognl to a version that resolves this vulnerability.

    Fixed in 3.4.13
  2. Configuration

    Use a restrictive MemberAccess implementation that excludes dangerous classes and the java.lang.reflect package when evaluating untrusted OGNL expressions.

    OGNL MemberAccess = restrictive MemberAccess, such as Apache Struts SecurityMemberAccess
  3. Configuration

    Enable stricter invocation and ensure its block list includes java.lang.reflect.Method, java.lang.reflect.Constructor, and java.lang.reflect.Field to prevent reflection objects from being used as invocation proxies.

    OGNL stricter-invocation block list = Include java.lang.reflect.Method, java.lang.reflect.Constructor, and java.lang.reflect.Field

Event History

Oct 21, 2026
Advisory Published
via GitHub·04:31 PM
Data Sourced
via GitHub·04:31 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Is the default OGNL context affected?

Yes. The proof of concept succeeds with OGNL's default context, using public-only access with stricter invocation enabled.

2

What capability would an attacker need to exploit this?

An attacker would need a way to have an OGNL expression evaluated. They can use Java reflection methods such as Method.invoke() to call methods that stricter invocation would otherwise block directly.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203