CVE-2026-19135: How a Low-Privileged User Bypasses the OpenNMS JEXL Sandbox to Load Arbitrary Classes
The OpenNMS JEXL sandbox keys method permission checks on the class represented by a Class object rather than on java.lang.Class itself, so a whitelisted class such as TreeBasedTable can be used to reach the entire reflective method surface. A low-privileged authenticated user could load arbitrary classes and read filesystem paths, though no reachable gadget for code execution was found on the default classpath.
Published on medium.com
Cve 2026 19135
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context: a sandbox that was supposed to be the safe version
OpenNMS Horizon lets users define JEXL expressions in the Measurements API, the feature that renders performance graphs. A client submits a filter of type JEXL, and the server evaluates the expression against the metrics data for a resource. The feature has to run attacker-influenced expressions by design, so everything rests on the sandbox keeping those expressions away from anything dangerous.
JEXL is Apache Commons' expression language, and it has a long history of sandbox escapes across many products. The OpenNMS sandbox was introduced years ago to remediate a JEXL RCE, CVE-2021-3396. That is what made it worth pulling apart: it is supposed to be the fixed version.
The sandbox has two pieces:
OnmsJexlUberspect, the class JEXL calls to resolve every method and property access at runtime.OnmsJexlSandbox, a per-class permission table. A class is either whitelisted (all names allowed) or governed by an explicit allow/deny set.

The Measurements filter sets the sandbox up like this in JEXL.java:
jexl = new OnmsJexlEngine();jexl.white(Math.class.getName());jexl.white(StrictMath.class.getName());jexl.white(TreeBasedTable.class.getName());...jexlValues.put("table", qrAsTable); final JexlContext context = new MapContext(jexlValues);
Three classes are whitelisted: Math, StrictMath and Guava's TreeBasedTable. A live TreeBasedTable instance is placed into the evaluation context under the name table. Whitelisting a data-structure class only lets the expression call table.get(...), table.rowMap() and similar methods, which is the intent. The mistake is not in what was whitelisted but in how the sandbox decides whether a call is allowed.
Setup
The researcher built a small harness around the verbatim 36.0.2 sandbox classes, OnmsJexlUberspect, OnmsJexlSandbox and OnmsJexlEngine, running on the exact commons-jexl 2.1.1 that OpenNMS ships. The harness used the real whitelist and a TreeBasedTable bound as table, so the testing was against the actual control rather than a paraphrase of it.
For the gadget analysis, the researcher used the real OpenNMS 36.0.2 classpath: the shipped libopennmsdeps-java and libopennms-java packages, 929 jars and about 180,000 classes.
On the reachability side, no special role is needed. applicationContext-spring-security.xml contains:
<intercept-url pattern="/rest/measurements" method="POST" access="ROLE_REST,ROLE_ADMIN,ROLE_USER"/>
POST /rest/measurements is authorised for ROLE_USER, the lowest authenticated role in OpenNMS. The request flows into MeasurementsRestService.query, through filterEngine.filter(getFilters(), table), and the JEXL filter in the request body is evaluated against the seeded table context. Any low-privileged authenticated user can submit the escape.
Finding it: the wrong identity in the permission lookup
The function that runs on every method call inside an expression is OnmsJexlUberspect.getMethod():
public JexlMethod getMethod(final Object obj, final String method, final Object[] args, final JexlInfo info) { if (obj != null && method != null) { final String className; if (obj instanceof Class) { Class<?> clazz = (Class) obj; className = clazz.getName(); } else { className = obj.getClass().getName(); } String actual = this.sandbox.execute(className, method); if (actual != null) { return this.getMethodExecutor(obj, actual, args); } } return null;}
The if (obj instanceof Class) branch is the whole bug. When the object a method is being called on is itself a java.lang.Class instance, the sandbox keys its permission lookup on ((Class) obj).getName(), the name of the class that the Class object represents, instead of on java.lang.Class, the object's actual type.
That matters because of how a whitelisted class is treated:
public Permissions white(String clazz) { return permissions(clazz, true, true, true); }
A whitelisted class allows every method name. So a Class object that stands for a whitelisted type unlocks the entire java.lang.Class method surface: getClassLoader(), getProtectionDomain(), getResource(), forName() and the rest.
There is a clear tell that this is an oversight rather than a design decision. The sibling function in the same class, getPropertyGet(), keys correctly:
public JexlPropertyGet getPropertyGet(final Object obj, final Object identifier, final JexlInfo info) { if (obj != null && identifier != null) { String actual = this.sandbox.read(obj.getClass().getName(), identifier.toString()); ... }}
getPropertyGet always uses obj.getClass().getName(). The property form, table.class.classLoader, is therefore keyed as java.lang.Class, which is not whitelisted, and is blocked. Only the method path is mis-keyed. That asymmetry is why the escape has to go through table.getClass().getClassLoader(), a method call, rather than table.class.classLoader, a property. One of the two paths got the check right; the other did not.
Exploitation
Step 1: obtain a Class object for a whitelisted type
table is a TreeBasedTable, and TreeBasedTable is whitelisted. Calling table.getClass() returns a java.lang.Class object that represents TreeBasedTable.
Step 2: call a method on that Class object
getMethod() sees obj instanceof Class, keys the lookup on "com.google.common.collect.TreeBasedTable", finds it whitelisted, and allows the call. The escape expressions and what they returned:
table.getClass().getClassLoader() -> the live AppClassLoadertable.getClass().getProtectionDomain() -> the code source (absolute jar path)table.getClass().getResource('/') -> absolute filesystem path of the webapptable.getClass().forName('java.lang.Runtime') -> loads + static-initializes an arbitrary class
The negative controls matter just as much:
table.class.classLoader -> BLOCKED (property path is keyed correctly as java.lang.Class)getRuntime() -> BLOCKED (returned object re-keys to a non-whitelisted class)loadClass(...) / getCodeSource() -> BLOCKED (same reason)
The last set marks the boundary of the primitive. getRuntime() is blocked because the returned object re-keys to a non-whitelisted class, and loadClass(...) and getCodeSource() are blocked for the same reason.
Step 3: establish how far the primitive goes
The primitive is arbitrary class loading with static-initializer execution via forName(...). In Java, Class.forName("X") does not just hand back a Class: it loads and runs the static initializer of X. An arbitrary-class-load primitive is, in the general case, one gadget away from code execution. The next step is to find a class already on the server's classpath whose <clinit>, or a trivially reachable path from it, does something dangerous with input the attacker can influence.
The researcher scanned the real OpenNMS 36.0.2 classpath with a bytecode call-graph scan for every class with a static initializer that reaches a dangerous sink (Runtime.exec, ProcessBuilder, JNDI lookup, System.load, file write, outbound URL) within a few hops. Of the 180,000 or so classes, 28,892 have a <clinit>, and 91 of them reach a sink.
Each RCE-shaped candidate was then reviewed by hand. Every one used fixed or ambient input, never something a Measurements-API caller can set: Drools' executor holder reads a JNDI name from a system property; oshi and jnr shell out to hard-coded lshw/id; the native loaders just System.loadLibrary a bundled .so. The researcher also confirmed dynamically, through the actual escape, that these static initializers do fire: a native library got extracted and a hard-coded id -u ran under a disarmed shim. That proves the primitive is real and the classes are loaded, but it also proves the inputs are not attacker-controlled.
Root cause
The sandbox was built on an implicit assumption: that the object arriving at getMethod() is a normal instance, so keying on "the class it represents" and "the class it is" are the same thing. For every ordinary object they are. For a java.lang.Class object they diverge completely, because the represented class and the actual class (java.lang.Class) are different, and the code picked the wrong one.
On top of that sits a whitelist model where "trusted" means "all methods allowed". A single trusted data-structure class therefore becomes a skeleton key for reflection. The whitelist was not wrong to trust TreeBasedTable as a container; it was wrong to let a Class object borrow that trust.
Impact
The escape gives information disclosure plus a protection-mechanism failure, scored by the researcher at CVSS 5.4. It reaches the doorstep of RCE, since arbitrary class loading is exactly the primitive you would weaponise, but on the default classpath there is no reachable gadget with attacker-influenced input. The gap is a single classpath gadget: a third-party OpenNMS plugin that ships a class with an attacker-influenceable <clinit> would close it, which is itself a good reason to fix the mis-keying rather than rely on there being no gadget today.
Any low-privileged, authenticated user can trigger it through POST /rest/measurements, because ROLE_USER is sufficient. The researcher deliberately did not claim RCE, and instead proved the ceiling of the primitive.
Fix
OpenNMS applied two changes in PR #8754:
- Stop treating a runtime
java.lang.Classvalue as a static-type reference. Key it onjava.lang.Class, the waygetPropertyGetalready does, or rejectobj instanceof Classoutright. - Deny the reflective surface at the sandbox regardless of keying:
getClass,forName,getClassLoader,getProtectionDomain,getResource.
For a more durable fix, the researcher suggests a per-class method allowlist instead of a name-only whitelist where "trusted" equals "all methods". A newly trusted class would then expose only the handful of methods it actually needs, and reflection would never come along for the ride.
The issue is fixed in OpenNMS Meridian 2024.3.12 and 2025.0.9, and Horizon 36.0.3. If you run OpenNMS and it is reachable by any authenticated user, update.
- Other expression engines with class whitelists. Look for any sandbox that keys permissions on the represented class of a
Classobject rather than onjava.lang.Class. A positive result is a call such assomeWhitelistedInstance.getClass().getClassLoader()returning a live class loader instead of being blocked. - Property versus method asymmetry. For each sandbox, compare the property path and the method path for the same access. If
x.class.classLoaderis blocked butx.getClass().getClassLoader()is not, the method path is mis-keyed. A positive result is the method form returning a class loader, protection domain or resource path. forNamereachability. Check whetherClass.forNameis callable through the escape and whether any class on the target classpath has a static initializer that reaches a dangerous sink with attacker-influenceable input. A positive result is a class whose<clinit>executes a command, performs a JNDI lookup, loads a native library or writes a file using data the caller controls.- Whitelisted container classes. Enumerate every class the sandbox whitelists and check whether any of them can hand back a
Classobject, a class loader or a reflective handle. A positive result is any whitelisted type whose instance exposes a method returningClassorClassLoader. - Low-privilege reachability. For each candidate endpoint that accepts an expression filter, confirm the lowest authenticated role that can reach it. A positive result is a role such as
ROLE_USERbeing sufficient to submit the expression.
What happened, in plain words
OpenNMS Horizon is a piece of software that companies use to watch their computer networks: it collects numbers from servers, switches and other devices and draws graphs so that an administrator can see whether everything is healthy. One of its features lets a user write a small formula that is applied to those numbers before the graph is drawn. That formula is written in a language called JEXL.
Because the formula comes from a user, the server cannot simply trust it. Someone could write a formula that does something harmful instead of just adding up numbers. To prevent that, OpenNMS wraps the formula language in a sandbox: a set of rules that decides which actions a formula is allowed to perform and which it is not. Think of a sandbox the way you think of a playpen for a toddler: the child can move around freely inside it, but cannot reach the kitchen knives.
The researcher in this report, Xanlar Agamalizade, went looking for a way out of that playpen. He found one. A user with the lowest possible level of access, an ordinary logged-in account, can write a formula that makes the server hand over information about itself and load arbitrary Java classes, running their static initializers. The weakness was given the identifier CVE-2026-19135. A CVE is a public catalogue number for a security flaw, a bit like a case number for a bug, so that vendors, scanners and other researchers can all refer to the same thing.
What makes the story interesting is where the bug lived. It was not in the formula language itself. It was inside the sandbox, the very protection that had been added years earlier to fix an older, similar problem (CVE-2021-3396). The fix closed the exact path that had been reported before, but left the shape of the problem intact one call away.

The image is the article's title card for CVE-2026-19135.
The feature and the protection around it
What the Measurements API is
An API (Application Programming Interface) is a way for one program to talk to another over the network. When you use a website, your browser sends requests to the site's server and the server sends back pages; an API is the same idea, but the answers are usually raw data rather than pretty pages, and the requests are made by other software rather than by a person clicking links. A REST API is a common style of such an interface where each thing you can act on has its own address (a URL) and you use standard HTTP methods such as GET (read) and POST (send something) to act on it.
OpenNMS has a Measurements API. Its job is to serve the performance data that ends up in graphs. A client can ask for the measurements of a particular resource (say, a server's CPU usage) and can attach a filter that is applied to the data before it is returned. One of the filter types is JEXL, which means: run this JEXL expression against the data.
What JEXL is
JEXL is an expression language from the Apache Commons project. An expression language is a small, simplified programming language meant for short formulas rather than whole programs. If you have ever typed =SUM(A1:A10) into a spreadsheet, you have used an expression language. JEXL expressions can do a bit more than spreadsheet formulas: they can call methods on objects, which means they can ask a piece of software to perform actions.
That last part is the danger. JEXL has a long history of sandbox escapes across many products: cases where someone found a way to make an expression do things the product's authors never intended. A sandbox escape is exactly what it sounds like: the rules were meant to keep the expression inside a safe area, and the expression got out.
The two pieces of the sandbox
The OpenNMS sandbox consists of two classes. A class in Java is a blueprint for a piece of software: it describes what data an object holds and what actions (methods) it can perform. An object is a live thing built from that blueprint. If a class is a cookie cutter, an object is a cookie.
OnmsJexlUberspectis the component that JEXL calls every time an expression tries to access a method or a property. It is the gatekeeper: it looks at what the expression wants to do and asks the sandbox whether that is allowed.OnmsJexlSandboxis the rule book. It keeps a table of permissions per class. A class is either whitelisted, meaning every method name on it is allowed, or it is governed by an explicit list of allowed and denied names.
A whitelist is a list of things that are permitted, with everything else refused. It is the opposite of a blacklist, which lists things that are forbidden and allows the rest. Whitelists are generally safer, because you do not have to guess every possible bad thing in advance.
How the filter is set up
The Measurements filter builds its JEXL engine like this, in a file called JEXL.java:
jexl = new OnmsJexlEngine();jexl.white(Math.class.getName());jexl.white(StrictMath.class.getName());jexl.white(TreeBasedTable.class.getName());...jexlValues.put("table", qrAsTable); final JexlContext context = new MapContext(jexlValues);
Line by line, in plain words:
jexl = new OnmsJexlEngine();creates the engine, the part that will actually run the expression.jexl.white(Math.class.getName());adds Java's built-in maths class,Math, to the whitelist.Math.class.getName()asks Java for the full name of that class as a piece of text, andwhite(...)marks that name as trusted.jexl.white(StrictMath.class.getName());does the same forStrictMath, another maths class.jexl.white(TreeBasedTable.class.getName());does the same forTreeBasedTable, a data-structure class from a library called Guava. A data structure is a way of organising information in memory, like a table with rows and columns.jexlValues.put("table", qrAsTable);puts a liveTreeBasedTableobject into the set of values the expression can see, under the nametable. So when the expression saystable, it is talking about this object.final JexlContext context = new MapContext(jexlValues);wraps those values into the context, the bundle of names and objects that the expression is evaluated against.
Nothing in that setup looks alarming. Whitelisting TreeBasedTable only lets an expression call methods such as table.get(...) or table.rowMap(), which read data out of the table. That is the intent. The mistake is not in what was whitelisted. It is in how the sandbox decides whether a call is allowed.
Setting up the test
Before claiming anything, the researcher reproduced the problem in a controlled way. He built a small test harness, meaning a minimal program whose only purpose is to exercise the code under study, around the exact sandbox classes from OpenNMS 36.0.2: OnmsJexlUberspect, OnmsJexlSandbox and OnmsJexlEngine. He ran them on the exact version of the JEXL library that OpenNMS ships, commons-jexl 2.1.1, with the real whitelist and a TreeBasedTable bound as table. The point of using the real files rather than rewriting them is that a rewritten copy might behave differently from the real thing, and then the finding would be about the copy, not about OpenNMS.
For the later analysis of how far the problem could go, he used the real OpenNMS 36.0.2 classpath: the shipped libopennmsdeps-java and libopennms-java packages, 929 jars and about 180,000 classes. A jar is a single file that bundles many Java classes together, the way a zip file bundles documents. The classpath is the full set of places Java looks when it needs to load a class.
On the question of who can reach the feature, no special role is needed. The file applicationContext-spring-security.xml contains:
<intercept-url pattern="/rest/measurements" method="POST" access="ROLE_REST,ROLE_ADMIN,ROLE_USER"/>
This is a rule from Spring Security, a framework that decides who may call which URL. In plain words:
pattern="/rest/measurements"says the rule applies to the URL path/rest/measurements.method="POST"says it applies to POST requests, the kind used to send data to the server.access="ROLE_REST,ROLE_ADMIN,ROLE_USER"says the request is allowed if the caller has any of these three roles. A role is a label attached to an account that describes its privileges.ROLE_ADMINis an administrator,ROLE_USERis an ordinary user, andROLE_USERis the lowest authenticated role in OpenNMS. Authenticated simply means logged in.
So any logged-in user, even the least privileged one, can send a POST request to /rest/measurements. That request flows into MeasurementsRestService.query, then through filterEngine.filter(getFilters(), table), and the JEXL filter in the request body is evaluated against the seeded table context. In everyday terms: the request arrives, the server picks the filter out of it, and runs that filter as an expression with the table available under the name table.
Finding the bug: the wrong identity in the permission check
The function that runs on every method call inside an expression is OnmsJexlUberspect.getMethod():
public JexlMethod getMethod(final Object obj, final String method, final Object[] args, final JexlInfo info) { if (obj != null && method != null) { final String className; if (obj instanceof Class) { Class<?> clazz = (Class) obj; className = clazz.getName(); } else { className = obj.getClass().getName(); } String actual = this.sandbox.execute(className, method); if (actual != null) { return this.getMethodExecutor(obj, actual, args); } } return null;}
Line by line, in plain words:
public JexlMethod getMethod(...)declares the function. It receives the object the method is being called on (obj), the name of the method (method), the arguments (args) and some information about where in the expression the call came from (info).if (obj != null && method != null)is a basic sanity check: only continue if there is an object and a method name.final String className;prepares a variable to hold the name that will be used for the permission lookup.if (obj instanceof Class)asks a question: is this object itself aClassobject? In Java,Classis a special class whose objects describe other classes. AClassobject is like the cookie cutter's own label: it is not a cookie, it is a description of a cutter.instanceofis the Java operator that tests whether an object is of a given type.Class<?> clazz = (Class) obj;andclassName = clazz.getName();take the name of the class that thisClassobject represents. If the object describesTreeBasedTable, the name iscom.google.common.collect.TreeBasedTable.} else { className = obj.getClass().getName(); }is the normal path: for an ordinary object, take the name of the class the object actually is.String actual = this.sandbox.execute(className, method);asks the sandbox whether that class name plus that method name is allowed.if (actual != null) { return this.getMethodExecutor(obj, actual, args); }if the sandbox says yes, the call is carried out.return null;otherwise the call is refused.
The if (obj instanceof Class) branch is the whole bug. When the object a method is being called on is itself a java.lang.Class instance, the sandbox keys its permission lookup on ((Class) obj).getName(), the name of the class that the Class object represents, instead of on java.lang.Class, the object's actual type. In everyday terms: the guard checks the label on the cookie cutter instead of checking that the visitor is holding a cookie cutter at all.
That matters because of how a whitelisted class is treated:
public Permissions white(String clazz) { return permissions(clazz, true, true, true); }
In plain words: white(String clazz) takes a class name and calls permissions(clazz, true, true, true). The call passes three true values, and a whitelisted class therefore allows every method name. A whitelisted class therefore allows every method name. There is no list of specific methods; the whole class is trusted.
Put the two facts together and the escape writes itself. A Class object that stands for a whitelisted type unlocks the entire java.lang.Class method surface: getClassLoader(), getProtectionDomain(), getResource(), forName() and the rest. Those are methods that let software inspect and load other software, which is exactly what the sandbox exists to prevent.
There is a clear tell that this is an oversight rather than a design decision. The sibling function in the same class, getPropertyGet(), keys correctly:
public JexlPropertyGet getPropertyGet(final Object obj, final Object identifier, final JexlInfo info) { if (obj != null && identifier != null) { String actual = this.sandbox.read(obj.getClass().getName(), identifier.toString()); ... }}
In plain words: this function handles the property form of access, such as table.class or table.rowMap. It always uses obj.getClass().getName(), the name of the class the object actually is, never the name of a class the object might represent. So the property form table.class.classLoader is keyed as java.lang.Class, which is not whitelisted, and it is blocked. Only the method path is mis-keyed. That asymmetry is why the escape has to go through table.getClass().getClassLoader(), a method call, rather than table.class.classLoader, a property. One of the two paths got the check right; the other did not.
Exploiting it, step by step
Step 1: obtain a Class object for a whitelisted type
table is a TreeBasedTable, and TreeBasedTable is whitelisted. Calling table.getClass() returns a java.lang.Class object that represents TreeBasedTable. getClass() is a method every Java object has; it answers the question "what class am I?" with a Class object. The researcher took this step because the bug only triggers when the object being called on is a Class object, so he first needed to get hold of one that describes a whitelisted class.
Step 2: call a method on that Class object
getMethod() sees obj instanceof Class, keys the lookup on "com.google.common.collect.TreeBasedTable", finds it whitelisted, and allows the call. The escape expressions and what they returned:
table.getClass().getClassLoader() -> the live AppClassLoadertable.getClass().getProtectionDomain() -> the code source (absolute jar path)table.getClass().getResource('/') -> absolute filesystem path of the webapptable.getClass().forName('java.lang.Runtime') -> loads + static-initializes an arbitrary class
Line by line, in plain words:
table.getClass().getClassLoader()asks for the class loader, the part of Java responsible for finding and loading classes. The answer was the liveAppClassLoader, the loader that handles the application's own classes. Knowing which loader is in use tells an attacker how the software is put together.table.getClass().getProtectionDomain()asks for the protection domain, which records where the class's code came from. The answer was the code source, including the absolute path of the jar file on disk. That leaks the layout of the server's filesystem.table.getClass().getResource('/')asks for a resource, here the root of the classpath. The answer was the absolute filesystem path of the web application. Again, information about the server's internal layout.table.getClass().forName('java.lang.Runtime')asks Java to load a class by name.java.lang.Runtimeis the class that lets Java programs interact with the operating system. The answer was that the class was loaded and its static initializer ran. A static initializer is a block of code that Java runs automatically the first time a class is loaded, before anything else in that class is used. It is like the setup instructions that run when you first open a piece of flat-pack furniture.
The negative controls matter just as much:
table.class.classLoader -> BLOCKED (property path is keyed correctly as java.lang.Class)getRuntime() -> BLOCKED (returned object re-keys to a non-whitelisted class)loadClass(...) / getCodeSource() -> BLOCKED (same reason)
A negative control is a test you expect to fail, run to prove that your test setup is not simply allowing everything. In plain words:
table.class.classLoaderis blocked because the property path is keyed correctly asjava.lang.Class, which is not whitelisted.getRuntime()is blocked because the object it returns is then checked again, and that object's class is not whitelisted.loadClass(...)andgetCodeSource()are blocked for the same reason.
These results mark the boundary of the primitive. A primitive in security means a basic capability you have gained, which you might then build on. Here the primitive is: you can call methods on a Class object that represents a whitelisted type, though some follow-on calls are still blocked.
Step 3: establish how far the primitive goes
The primitive is arbitrary class loading with static-initializer execution via forName(...). In Java, Class.forName("X") does not just hand back a Class: it loads and runs the static initializer of X. An arbitrary-class-load primitive is, in the general case, one gadget away from code execution. A gadget here means an existing piece of software already on the server that, when triggered, does something harmful. The analogy is a row of dominoes: you do not need to push the last one yourself if you can find a way to push the first one and the rest fall.
The next step is to find a class already on the server's classpath whose <clinit>, or a trivially reachable path from it, does something dangerous with input the attacker can influence. <clinit> is the internal name Java uses for a class's static initializer.
The researcher scanned the real OpenNMS 36.0.2 classpath with a bytecode call-graph scan. Bytecode is the compiled form of Java code, the instructions the Java runtime actually executes. A call-graph scan is an automated analysis that follows which function calls which, so it can trace a path from one piece of code to another. The scan looked for every class with a static initializer that reaches a dangerous sink within a few hops. A sink is a place where data leaves the program or an action with real consequences happens: running a command, opening a network connection, writing a file. The sinks searched for were Runtime.exec, ProcessBuilder, JNDI lookup, System.load, file write and outbound URL. Runtime.exec and ProcessBuilder are ways to start other programs on the machine; JNDI is a Java naming service that can be made to fetch code from elsewhere; System.load loads a native library, a piece of compiled code written in another language such as C.
Of the 180,000 or so classes, 28,892 have a <clinit>, and 91 of them reach a sink. In other words, the automated scan narrowed the field from a huge number to a shortlist.
Each RCE-shaped candidate was then reviewed by hand. RCE stands for remote code execution: the ability for an attacker to make the server run code of the attacker's choosing, which is the most severe kind of outcome. Every candidate used fixed or ambient input, never something a Measurements-API caller can set. Fixed input means the value is hard-coded in the software; ambient input means it comes from the environment, such as a system property, rather than from the request. Specifically: Drools' executor holder reads a JNDI name from a system property; oshi and jnr shell out to hard-coded lshw/id; the native loaders just System.loadLibrary a bundled .so. A .so is a shared library file on Linux, the equivalent of a .dll on Windows.
The researcher also confirmed dynamically, through the actual escape, that these static initializers do fire: a native library got extracted and a hard-coded id -u ran under a disarmed shim. Dynamically means by actually running it, as opposed to reading the code. A shim is a small stand-in that intercepts a call and does something harmless instead, so that the test can observe the call without causing real damage. That proves the primitive is real and the classes are loaded, but it also proves the inputs are not attacker-controlled. In everyday terms: the dominoes do fall, but nobody can reach the first one from the outside.
Root cause
The sandbox was built on an implicit assumption: that the object arriving at getMethod() is a normal instance, so keying on "the class it represents" and "the class it is" are the same thing. For every ordinary object they are. For a java.lang.Class object they diverge completely, because the represented class and the actual class (java.lang.Class) are different, and the code picked the wrong one.
On top of that sits a whitelist model where "trusted" means "all methods allowed". A single trusted data-structure class therefore becomes a skeleton key for reflection. Reflection is the ability of a program to inspect and manipulate other classes at runtime: to ask what methods a class has, to load a class by name, to call things it did not know about when it was written. The whitelist was not wrong to trust TreeBasedTable as a container; it was wrong to let a Class object borrow that trust.
Impact
The escape gives information disclosure plus a protection-mechanism failure, scored by the researcher at CVSS 5.4. Information disclosure means the server reveals information it should not, such as file paths and class loader details. A protection-mechanism failure means the security control itself did not work as intended. CVSS is the Common Vulnerability Scoring System, a standard way of expressing severity as a number, where higher is worse; 5.4 is in the middle range.
The escape reaches the doorstep of RCE, since arbitrary class loading is exactly the primitive you would weaponise, but on the default classpath there is no reachable gadget with attacker-influenced input. The gap is a single classpath gadget: a third-party OpenNMS plugin that ships a class with an attacker-influenceable <clinit> would close it, which is itself a good reason to fix the mis-keying rather than rely on there being no gadget today. A plugin is an add-on that extends the software, often written by someone other than the original vendor.
Any low-privileged, authenticated user can trigger it through POST /rest/measurements, because ROLE_USER is sufficient. The researcher deliberately did not claim RCE, and instead proved the ceiling of the primitive. That distinction matters: claiming more than you can prove makes a report harder to act on, while showing exactly how far the problem goes gives the vendor a clear picture.
Fix
OpenNMS applied two changes in PR #8754. A PR, or pull request, is a proposed change to a codebase that the maintainers review before merging it in.
- Stop treating a runtime
java.lang.Classvalue as a static-type reference. Key it onjava.lang.Class, the waygetPropertyGetalready does, or rejectobj instanceof Classoutright. In plain words: either check the object's real type, or refuse to handleClassobjects at all. - Deny the reflective surface at the sandbox regardless of keying:
getClass,forName,getClassLoader,getProtectionDomain,getResource. In plain words: even if the name check is fixed, explicitly forbid the methods that let an expression poke around inside Java.
For a more durable fix, the researcher suggests a per-class method allowlist instead of a name-only whitelist where "trusted" equals "all methods". A newly trusted class would then expose only the handful of methods it actually needs, and reflection would never come along for the ride. The everyday comparison is a building pass that opens only the rooms you need, rather than a master key that opens every door in the building.
The issue is fixed in OpenNMS Meridian 2024.3.12 and 2025.0.9, and Horizon 36.0.3. If you run OpenNMS and it is reachable by any authenticated user, update.
These are the general lessons the researcher drew, written as things to try on other software.
- Other expression engines with class whitelists. Look for any sandbox that keys permissions on the represented class of a
Classobject rather than onjava.lang.Class. A positive result is a call such assomeWhitelistedInstance.getClass().getClassLoader()returning a live class loader instead of being blocked. - Property versus method asymmetry. For each sandbox, compare the property path and the method path for the same access. If
x.class.classLoaderis blocked butx.getClass().getClassLoader()is not, the method path is mis-keyed. A positive result is the method form returning a class loader, protection domain or resource path. forNamereachability. Check whetherClass.forNameis callable through the escape and whether any class on the target classpath has a static initializer that reaches a dangerous sink with attacker-influenceable input. A positive result is a class whose<clinit>executes a command, performs a JNDI lookup, loads a native library or writes a file using data the caller controls.- Whitelisted container classes. Enumerate every class the sandbox whitelists and check whether any of them can hand back a
Classobject, a class loader or a reflective handle. A positive result is any whitelisted type whose instance exposes a method returningClassorClassLoader. - Low-privilege reachability. For each candidate endpoint that accepts an expression filter, confirm the lowest authenticated role that can reach it. A positive result is a role such as
ROLE_USERbeing sufficient to submit the expression.
Glossary
- API: a defined way for one piece of software to talk to another over a network, usually exchanging data rather than web pages.
- Authenticated: logged in, that is, having proved your identity to the system.
- Bytecode: the compiled instructions that the Java runtime executes.
- Call-graph scan: an automated analysis that follows which function calls which, tracing paths through code.
- Class: in Java, a blueprint that describes what data an object holds and what actions it can perform.
- Class loader: the part of Java that finds and loads classes when they are needed.
- Classpath: the full set of locations Java searches when it needs to load a class.
<clinit>: the internal name for a class's static initializer.- CVE: a public catalogue number for a security flaw, so that everyone can refer to the same issue.
- CVSS: a standard scoring system for the severity of a security flaw, where higher numbers are worse.
- Data structure: a way of organising information in memory, such as a table with rows and columns.
- Gadget: an existing piece of software on a system that, when triggered, performs a harmful action an attacker can chain into.
- Information disclosure: a flaw where the system reveals information it should keep private.
- Jar: a single file bundling many Java classes, similar to a zip archive.
- JEXL: an expression language from Apache Commons, used for short formulas that can also call methods on objects.
- JNDI: a Java naming service that can be used to look up resources, and which can be abused to fetch code from elsewhere.
- Method: an action that an object can perform, defined in its class.
- Negative control: a test you expect to fail, run to prove your setup is not simply allowing everything.
- Object: a live thing built from a class, the way a cookie is made from a cookie cutter.
- Plugin: an add-on that extends a piece of software, often written by a third party.
- PR (pull request): a proposed change to a codebase that maintainers review before merging.
- Primitive: a basic capability gained through a flaw, which may then be built upon.
- Protection domain: a Java record of where a class's code came from and what it is allowed to do.
- RCE (remote code execution): the ability for an attacker to make a server run code of the attacker's choosing; the most severe outcome.
- Reflection: a program's ability to inspect and manipulate other classes at runtime, including loading classes by name.
- REST API: a common style of API where each thing you can act on has its own URL and standard HTTP methods are used to act on it.
- Role: a label attached to an account describing its privileges, such as administrator or ordinary user.
- Sandbox: a set of rules that limits what code from an untrusted source is allowed to do.
- Sandbox escape: a case where code gets past those rules and does something the sandbox was meant to prevent.
- Shim: a small stand-in that intercepts a call and does something harmless instead, so a test can observe it safely.
- Sink: a place in code where data leaves the program or an action with real consequences happens, such as running a command or writing a file.
- Static initializer: a block of code Java runs automatically the first time a class is loaded.
- Whitelist: a list of things that are permitted, with everything else refused.