Skip to content

Commit

Permalink
Use SafeConstructor() instead of Constructor() (#6205) (#6208)
Browse files Browse the repository at this point in the history
(cherry picked from commit a5dc22a)

Signed-off-by: Andrew Ross <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 905b2ad commit 7164ef2
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 7164ef2

Please sign in to comment.