lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Sat, 10 Oct 2020 14:03:18 +0200
From: "Securify B.V. via Fulldisclosure" <>
Subject: [FD] Java deserialization vulnerability in QRadar RemoteJavaScript

Java deserialization vulnerability in QRadar RemoteJavaScript Servlet
A Java deserialization vulnerability exists in the QRadar
RemoteJavaScript Servlet. An authenticated user can call one of the
vulnerable methods and cause the Servlet to deserialize arbitrary

An attacker can exploit this vulnerability by creating a specially
crafted (serialized) object, which amongst other things can result in a
denial of service, change of system settings, or execution of arbitrary

See also
CVE-2020-4280 [2]
6344079 [3] - IBM QRadar SIEM is vulnerable to deserialization of
untrusted data

Tested versions
This issue was successfully verified on QRadar Community Edition [4]
version (7.3.1 Build 20180723171558).

IBM has released the following versions of QRader in which this issue
has been resolved:

- QRadar / QRM / QVM / QRIF / QNI 7.4.1 Patch 1 [5]
- QRadar / QRM / QVM / QRIF / QNI 7.3.3 Patch 5 [6]

QRadar [7] is IBM's enterprise SIEM [8] solution. A free version of
QRadar is available that is known as QRadar Community Edition [4]. This
version is limited to 50 events per second and 5,000 network flows a
minute, supports apps, but is based on a smaller footprint for
non-enterprise use.

A Java deserialization vulnerability [9] exists in the QRadar
RemoteJavaScript Servlet. This Servlet contains a custom JSON-RPC [10]
implementation (based on JSON-RPC version 1.0). Certain methods accept
base64 encoded serialized Java objects. No checks have been implemented
to prevent deserialization of arbitrary objects. Consequently, an
authenticated user can call one of the affected methods and cause the
RemoteJavaScript Servlet to deserialize arbitrary objects.

An attacker can exploit this vulnerability by creating a specially
crafted (serialized) object,  which amongst other things can result in a
denial of service, change of system settings, or execution of arbitrary

The RemoteJavaScript Servlet is only accessible for authenticated users.
It is mapped to the following URLs:

- /remoteJavaScript
- /remoteMethod

The JSON data can be passed via the URL query string or as POST data.
The JSON data should contain a field named method, which contains the
name of the application and the method that needs to be invoked. The
requested application is looked up in the Application Registry. Each
application has a mapping XML file located under
/opt/qradar/conf/appconfig/ named <appname>-exported_methods.xml, which
is essentially a list of all (Java) methods that can be called including
their associated Java class, access control, and other settings.

When the application is found (and licensed), a call is made to
getExportedMethod() to lookup the Java method that needs to be invoked.
After some additional checks - like authorization - the Servlet will
eventually invoke the call() method of the found Java method. If
present, arguments are passed as a String array to the call() method.
These arguments are then converted into the correct type using the
com.q1labs.core.shared.util.ReflectionUtils.stringsToObjects() method.

public abstract class ExportedMethod extends AllowableObject {
    public Object call(PageContext pageContext, String... passedArguments)
throws Exception {
        if (passedArguments != null && passedArguments.length != 0) {
            if (this.log.isDebugEnabled()) {
                this.log.debug("Calling with passed in arguments: " +

    private Object[] stringsToObjects(String[] paramaters) throws
ExportedMethodException {
        return ReflectionUtils.stringsToObjects(this.getParameterTypes(),

The parameter types differ per method and are provided via the
getParameterTypes() method. If the parameter type is a 'simple' type, it
will be converted without deserialization. However, some methods also
accept complex types, which are passed as serialized objects.

public class ReflectionUtils {
    public static Object stringToObject(Class type, String param) throws
NoSuchMethodException, InvocationTargetException,
InstantiationException, IllegalAccessException {
        long i;
        int i;
        if (type.isPrimitive()) {
            if (type.equals(Integer.TYPE)) {
                if (param == null) {
                    param = "0";
                i = (new Double(param)).longValue();
                if (i > 2147483647L) {
                    i = 0L - (2147483647L - i);
                return (int)i;
            } else if (type.equals(Character.TYPE)) {
                return param.charAt(0);
            } else if (type.equals(Double.TYPE)) {
                return new Double(param);
            } else {
                throw new RuntimeException("Unknown primitive type: " +
        } else if (param != null && !param.equalsIgnoreCase("$_NULL_$")) {
            if (type.equals(Short.class)) {
                i = (new Double(param)).intValue();
                if (i > 32767) {
                    i = 0 - (32767 - i);
                return (short)i;
            } else {
                return SerializationUtils.deserialize(Base64.decode(param));
    public static Object[] stringsToObjects(Class[] types, String...
parameters) throws RuntimeException {
        Pattern arrayMatcher = Pattern.compile("^\\[(.+)\\]$");
        if (parameters != null && parameters.length > 0) {
            Object[] newArgs = new Object[types.length];
            for(int i = 0; i < types.length; ++i) {
            try {
                Class type = types[ i ];
                if (!type.isArray()) {
                    newArgs[ i ] = stringToObject(type, parameters[ i ]);

Deserialization of objects is done using the
org.apache.commons.lang3.SerializationUtils class. This class doesn't
perform any checks on the objects that are deserialized. Since no checks
are done in the RemoteJavaScript Servlet it can be abused to deserialize
arbitrary objects. An attacker can exploit this vulnerability by
creating a specially crafted (serialized) object.

Proof of concept
The JSON-RPC interface already contains a method that allows running of
arbitrary commands (as the nobody user). This method is named
qradar.executeCommand and can be called by any user, no special
privileges are required. However, the method checks if the property
console.enableExecuteCommand exists and is set to true. By default this
property doesn't exist and thus it is not possible to call this method
to run arbitrary commands. By utilizing the deserialization
vulnerability it is possible to create this property, after which it is
possible to use qradar.executeCommand to run arbitrary commands.

public static Object executeCommand(PageContext pageContext, String
command, int timeoutSeconds) throws Exception {
        throw new Exception("Cannot execute remote system commands");
    } else {
        File qradarDir = new File(NVAReader.getProperty("NVA",
        Process proc = Runtime.getRuntime().exec(new String[]{"/bin/sh",
command}, (String[])null, qradarDir);

One of the methods that can be used to trigger a deserialization
operation is the method qradar.validateChangesAssetConfiguration. This
method is mapped to the Java method
The method takes one argument of the type java.util.List.

The proof of concept uses a Jython gadget. The Jython Java library is
present in the Servlet's class path and consequently we can deserialize
objects found in this library. The ysoserial [11] payload generation
tool already contains a gadget [12] that uses the Jython library.
ysoserial's payload will first write a Python file to the target system,
after which the file is executed. The payload has been modified to
directly create the target property (console.enableExecuteCommand)
without the need to write a file to disk first. The payload is modified
to execute the following Python code (upon deserialization):

eval("__import__('com.q1labs.frameworks.util.QSystem', globals(),
locals(), ['setProperty'],
0).setProperty('console.enableExecuteCommand', 'true')")


Sent through the Full Disclosure mailing list
Web Archives & RSS:

Powered by blists - more mailing lists