Java methods in queries are now forbidden by default

#1

Starting with build 2.9.5_02, arbitrary methods in queries are forbidden, unless enabled explicitly before accessing ObjectDB by:

System.setProperty("objectdb.temp.unblock-query-methods", "true");

(or by running the JVM with -Dobjectdb.temp.unblock-query-methods=true).

The purpose of this change is to enhance security. You should only enable methods in queries after isolating the ObjectDB process, restricting other processes from executing direct queries on the database, and ensuring that unsanitized user input is never included in queries.

The following methods are considered safe and are excluded from this restriction:

  • String methods: toLowerCase, toUpperCase, startsWith, endsWith, matches, indexOf, andsubstring.

  • Collection methods: isEmpty, size, contains, containsKey, containsValue, get,  andcontainsAnyKey.

ObjectDB Support

Reply