spmallette commented on code in PR #3578:
URL: https://github.com/apache/tinkerpop/pull/3578#discussion_r3668587949


##########
hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/gryo/GryoRecordReader.java:
##########
@@ -73,7 +73,7 @@ public void initialize(final InputSplit genericSplit, final 
TaskAttemptContext c
         if (configuration.get(Constants.GREMLIN_HADOOP_GRAPH_FILTER, null) != 
null)
             this.graphFilter = 
VertexProgramHelper.deserialize(ConfUtil.makeApacheConfiguration(configuration),
 Constants.GREMLIN_HADOOP_GRAPH_FILTER);
         this.gryoReader = GryoReader.build().mapper(
-                
GryoMapper.build().addRegistries(IoRegistryHelper.createRegistries(ConfUtil.makeApacheConfiguration(configuration))).create()).create();
+                
GryoMapper.build().javaSerializationAllowed(false).addRegistries(IoRegistryHelper.createRegistries(ConfUtil.makeApacheConfiguration(configuration))).create()).create();

Review Comment:
   for our documentation sake, could you please add a comment as to why we 
disable java serialization here - something that say why it isn't necessary 
basically. my take is that as a record reader (and you need a similar comment 
in `GryoRecordWriter`) it is meant to serialize a graph `Element` which would 
not serialize things like `OptionsStrategy` and classes that use 
`JavaSerializer`. 
   
   this is in contrast to the `MapReduce` shuffle path (which we didn't 
change): `VertexWritable.write()`/`readFields()` go through 
`KryoShimServiceLoader`, which uses the `GryoPool` from `HadoopPools`. That 
pool is built with `initializeMapper(m -> m.registrationRequired(false))` — 
i.e. deliberately unlocked, and not hardened. That's consistent with the threat 
model, which explicitly places "the Hadoop object pools that additionally run 
unlocked" out-of-model (they only carry intra-job graph elements between mapper 
and reducer, not attacker-controlled bytes). I think you should probably add a 
clarifying comment there about why we didn't disable the `JavaSerializer` there.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to