Conversation
Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| protected static final List<String> ALLOWED_DESERIALIZATION_PACKAGES = Collections.unmodifiableList(Arrays.asList( | ||
| "org.broadleafcommerce.", | ||
| "java.lang.", | ||
| "java.util.", | ||
| "java.math.", | ||
| "java.time." | ||
| )); |
There was a problem hiding this comment.
🔴 Distributed Solr incremental updates fail to deserialize
The allow-list in ALLOWED_DESERIALIZATION_PACKAGES omits org.apache.solr, so reading an IncrementalUpdateCommand off the queue rejects its nested SolrInputDocument entries. Incremental Solr index updates over a Zookeeper-backed queue fail with a DistributedQueueException.
Prompt for agents
The deserialization allow-list restricts nested classes to org.broadleafcommerce, java.lang, java.util, java.math, and java.time. However, IncrementalUpdateCommand (placed on this queue via AbstractSolrIndexUpdateServiceImpl.updateIndex through DefaultSolrIndexQueueProvider.createDistributedQueue) holds a List<SolrInputDocument>, and SolrInputDocument/SolrInputField live in org.apache.solr.common. When a node reads such a command back, the ObjectInputFilter rejects org.apache.solr.common.* and deserialize() throws DistributedQueueException, breaking distributed incremental Solr indexing. Consider adding the org.apache.solr package prefix to the allowed packages (and verifying the concrete value types stored inside SolrInputField such as dates/numbers are also covered), or have the Solr queue subclass override isDeserializationAllowed to permit the Solr command types it actually enqueues.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
| protected static final List<String> ALLOWED_DESERIALIZATION_PACKAGES = Collections.unmodifiableList(Arrays.asList( | ||
| "org.broadleafcommerce.", | ||
| "java.lang.", | ||
| "java.util.", | ||
| "java.math.", | ||
| "java.time." | ||
| )); |
There was a problem hiding this comment.
🔍 Commercial com.broadleafcommerce packages not in allow-list
ALLOWED_DESERIALIZATION_PACKAGES covers org.broadleafcommerce but not com.broadleafcommerce, used by commercial modules. Entry or nested-field types from those packages are rejected unless a subclass overrides isDeserializationAllowed.
Was this helpful? React with 👍 or 👎 to provide feedback.
A Brief Overview
ZookeeperDistributedQueue.deserialize()calledObjectInputStream.readObject()on bytes read out of Zookeeper with no class filtering (CWE-502). Any party able to write to the queue's znodes (or the ZK ensemble itself, since the queue defaults toOPEN_ACL_UNSAFE) could get arbitrary classes instantiated on every node reading the queue — the standard path to RCE via a gadget chain on the classpath.Reads now go through an
ObjectInputFilter:org.broadleafcommerce.*,java.lang/util/math/time.*, always rejectsjava.lang.reflect.*andjava.lang.invoke.*, and everything not matched is rejected before the class is loaded. Array classes are checked by base component type; primitives pass.configs/maxCapacityread, whose type is known up front, usescreateTypeRestrictedDeserializationFilter(Integer.class). BecauseStringis encoded asTC_STRINGand never reaches the filter as a class, the type-restricted filter also validates the resulting object's exact class after the read.isDeserializationAllowed(Class)orcreateDeserializationFilter(); a rejected class is logged with the queue path and that hint.New
ZookeeperDistributedQueueDeserializationTestcovers allowed round trips, rejection of a disallowed type (java.io.File), the Integer-only filter acceptingIntegerwhile rejectingString, and reflection types being denied.Labels: Security, Severity: critical, Status: ready-for-code-review
Additional context
mvn -pl core/broadleaf-framework -am -DskipTests compileand the new test class pass locally; the wider module suite was not run.Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/ec83e007b8154be2a9766e428715a5ed
Requested by: @Colhodm
Devin Review
ea288f4