未验证 提交 5b84c5ad 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Fix CVE in the Apdex threshold configs, when activating the dynamic configuration feature. (#5811)

上级 756926ad
...@@ -37,6 +37,7 @@ Release Notes. ...@@ -37,6 +37,7 @@ Release Notes.
* Fix CVE in the alarm module, when activating the dynamic configuration feature. * Fix CVE in the alarm module, when activating the dynamic configuration feature.
* Fix CVE in the endpoint grouping, when activating the dynamic configuration feature. * Fix CVE in the endpoint grouping, when activating the dynamic configuration feature.
* Fix CVE in the uninstrumented gateways configs, when activating the dynamic configuration feature. * Fix CVE in the uninstrumented gateways configs, when activating the dynamic configuration feature.
* Fix CVE in the Apdex threshold configs, when activating the dynamic configuration feature.
* Make the codes and doc consistent in sharding server and core server. * Make the codes and doc consistent in sharding server and core server.
#### UI #### UI
......
...@@ -30,6 +30,7 @@ import org.apache.skywalking.oap.server.core.CoreModule; ...@@ -30,6 +30,7 @@ import org.apache.skywalking.oap.server.core.CoreModule;
import org.apache.skywalking.oap.server.core.CoreModuleProvider; import org.apache.skywalking.oap.server.core.CoreModuleProvider;
import org.apache.skywalking.oap.server.library.util.ResourceUtils; import org.apache.skywalking.oap.server.library.util.ResourceUtils;
import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
/** /**
* Apdex threshold configuration dictionary adapter. Looking up a service apdex threshold from dynamic config service. * Apdex threshold configuration dictionary adapter. Looking up a service apdex threshold from dynamic config service.
...@@ -94,7 +95,7 @@ public class ApdexThresholdConfig extends ConfigChangeWatcher implements Configu ...@@ -94,7 +95,7 @@ public class ApdexThresholdConfig extends ConfigChangeWatcher implements Configu
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void updateConfig(final Reader contentRender) { private void updateConfig(final Reader contentRender) {
dictionary = (Map<String, Integer>) new Yaml().load(contentRender); dictionary = (Map<String, Integer>) new Yaml(new SafeConstructor()).load(contentRender);
if (dictionary == null) { if (dictionary == null) {
dictionary = Collections.emptyMap(); dictionary = Collections.emptyMap();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册