Securing Data Deserialization
Restrict deserialization in GridGain with the IGNITE_MARSHALLER_WHITELIST and IGNITE_MARSHALLER_BLACKLIST system properties.
Serialized data is vulnerable to malicious data attacks if an attacker finds a way to add malicious code to the classpath of your cluster nodes. Best practice is to make sure that the access to the cluster is protected and granted only to a limited group of people.
However, if the attacker breaks through to your deployment environment, GridGain provides the ability to specify IGNITE_MARSHALLER_WHITELIST and IGNITE_MARSHALLER_BLACKLIST as system properties. These properties allow you to define a list of classes that will be allowed/disallowed for safe deserialization.
IGNITE_MARSHALLER_WHITELIST
To use IGNITE_MARSHALLER_WHITELIST, create a file containing the list of files allowed for deserialization. For example, a text file (whitelist.txt) would look like so:
ignite.myexamples.model.Address
ignite.myexamples.model.Person
...Then, set the system property when you run your application, or programmatically:
-DIGNITE_MARSHALLER_WHITELIST=path/to/whitelist.txtSystem.setProperty(IGNITE_MARSHALLER_WHITELIST, "Path/to/whitelist.txt");Substitute path/to/whitelist.txt with actual path to your whitelist file.
When the IGNITE_MARSHALLER_WHITELIST system property is used, an attempt to deserialize any file not on the whitelist will result in an exception:
Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Deserialization of class ignite.myexamples.model.Organization is disallowed.IGNITE_MARSHALLER_BLACKLIST
To use IGNITE_MARSHALLER_BLACKLIST, create a file containing the list of files disallowed for deserialization. For example, a text file (blacklist.txt) would look like so:
ignite.myexamples.model.SomeFile
ignite.myexamples.model.SomeOtherFile
...Then, set the system property when you run your application, or programmatically:
Substitute path/to/blacklist.txt with actual path to your blacklist file.
When the IGNITE_MARSHALLER_BLACKLIST system property is used, an attempt to deserialize any file mentioned on the blacklist will result in an exception:
Thin Client Continuous Query Filters
The whitelist and blacklist also apply to remote filters of continuous queries started from thin clients. A thin client can pass a remote filter by class name, for example with FactoryBuilder.factoryOf(MyFilter.class) in the Java thin client, or as a Java filter from the .NET and C++ thin clients. In this case, the server node checks the class name against IGNITE_MARSHALLER_WHITELIST and IGNITE_MARSHALLER_BLACKLIST before it loads the class. A filter class passed by name must implement javax.cache.event.CacheEntryEventFilter.
If the class is not allowed, the continuous query fails with a security error: Deserialization of class <class name> is disallowed.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

