Skip to content

Commit

Permalink
Use SafeConstructor() instead of Constructor() (opensearch-project#6205)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Ross <[email protected]>
  • Loading branch information
andrross authored Feb 6, 2023
1 parent 8c09378 commit a5dc22a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import org.opensearch.transport.TransportService;
import org.yaml.snakeyaml.Yaml;
import org.opensearch.env.EnvironmentSettingsResponse;
import org.yaml.snakeyaml.constructor.SafeConstructor;

/**
* The main class for managing Extension communication with the OpenSearch Node.
Expand Down Expand Up @@ -555,7 +556,7 @@ public String executor() {
}

private ExtensionsSettings readFromExtensionsYml(Path filePath) throws IOException {
Yaml yaml = new Yaml();
Yaml yaml = new Yaml(new SafeConstructor());
try (InputStream inputStream = Files.newInputStream(filePath)) {
Map<String, Object> obj = yaml.load(inputStream);
if (obj == null) {
Expand Down

0 comments on commit a5dc22a

Please sign in to comment.