You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2023/01/10 09:51:59 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #4162: HDDS-7760. snakeyaml workaround due to CVE-2022-1471

adoroszlai commented on code in PR #4162:
URL: https://github.com/apache/ozone/pull/4162#discussion_r1065559985


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/NodeSchemaLoader.java:
##########
@@ -227,7 +229,7 @@ private NodeSchemaLoadResult loadSchemaFromYaml(InputStream schemaFile) {
     NodeSchemaLoadResult finalSchema;
 
     try {
-      Yaml yaml = new Yaml();
+      Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));

Review Comment:
   Looks like this causes test failures:
   
   ```
    Tests run: 5, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 0.268 s <<< FAILURE! - in org.apache.hadoop.hdds.scm.net.TestYamlSchemaLoader
   ```
   
   https://github.com/rohit-kb/ozone/actions/runs/3882072979/jobs/6621790406#step:6:584
   
   Can you please check?



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/DatanodeIdYaml.java:
##########
@@ -56,7 +59,7 @@ public static void createDatanodeIdFile(DatanodeDetails datanodeDetails,
     DumperOptions options = new DumperOptions();
     options.setPrettyFlow(true);
     options.setDefaultFlowStyle(DumperOptions.FlowStyle.FLOW);
-    Yaml yaml = new Yaml(options);
+    Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()), new Representer(options), options);

Review Comment:
   ```
   hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/DatanodeIdYaml.java
    62: Line is longer than 80 characters (found 102).
   ```
   
   https://github.com/rohit-kb/ozone/actions/runs/3882072979/jobs/6621789972#step:6:427



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org