Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持或者兼容 Snakeyaml 2.0 #982

Closed
herodotus-ecosystem opened this issue Apr 27, 2023 · 4 comments · Fixed by #995 or #1001
Closed

支持或者兼容 Snakeyaml 2.0 #982

herodotus-ecosystem opened this issue Apr 27, 2023 · 4 comments · Fixed by #995 or #1001
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@herodotus-ecosystem
Copy link
Contributor

Snakeyaml 1.X 版存在较多漏洞,包括1.33 中,仍旧包含 (CVE-2022-1471) 存在反序列化漏洞 和 (CVE-2022-41854) 存在缓冲区溢出漏洞。

目前 Snakeyaml 2.0 已经发布,Spring Boot 2.7.11 和 3.0.5 虽然尚未将默认依赖的 Snakeyaml 的版本更新至 2.0,但也均已经做了兼容处理。使用新版本 Spring Boot,手动升级 Snakeyaml 至 2.0,服务可以正常运行。

个人现有的微服务工程,使用 Spring Boot 2.7.11 和 3.0.6,同时将 Snakeyaml 升级到 2.0 ,可以正常运行。将基础设施支持切换至 Spring Cloud Tencent 后,运行出错。

java.lang.IllegalStateException: [Config] failed to convert content to properties. namespace = herodotus, file group = development, file name = herodotus-cloud-environment.yaml
	at com.tencent.polaris.configuration.client.internal.ConfigYamlFile.convertToProperties(ConfigYamlFile.java:58) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.internal.ConfigPropertiesFile.initialize(ConfigPropertiesFile.java:87) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.internal.DefaultConfigFile.<init>(DefaultConfigFile.java:73) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.internal.ConfigPropertiesFile.<init>(ConfigPropertiesFile.java:74) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.internal.ConfigYamlFile.<init>(ConfigYamlFile.java:41) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.factory.DefaultConfigFileFactory.createConfigKVFile(DefaultConfigFileFactory.java:89) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.internal.DefaultConfigFileManager.getConfigKVFile(DefaultConfigFileManager.java:92) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.DefaultConfigFileService.getConfigYamlFile(DefaultConfigFileService.java:74) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.polaris.configuration.client.DefaultConfigFileService.getConfigYamlFile(DefaultConfigFileService.java:68) ~[polaris-configuration-client-1.12.0.jar:na]
	at com.tencent.cloud.polaris.config.adapter.PolarisConfigFilePuller.loadPolarisPropertySource(PolarisConfigFilePuller.java:147) ~[spring-cloud-starter-tencent-polaris-config-1.11.1-2022.0.1.jar:1.11.1-2022.0.1]
	at com.tencent.cloud.polaris.config.adapter.PolarisConfigFilePuller.initCustomPolarisConfigFile(PolarisConfigFilePuller.java:130) ~[spring-cloud-starter-tencent-polaris-config-1.11.1-2022.0.1.jar:1.11.1-2022.0.1]
	at com.tencent.cloud.polaris.config.adapter.PolarisConfigFilePuller.lambda$initCustomPolarisConfigFiles$0(PolarisConfigFilePuller.java:108) ~[spring-cloud-starter-tencent-polaris-config-1.11.1-2022.0.1.jar:1.11.1-2022.0.1]
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[na:na]
	at com.tencent.cloud.polaris.config.adapter.PolarisConfigFilePuller.initCustomPolarisConfigFiles(PolarisConfigFilePuller.java:107) ~[spring-cloud-starter-tencent-polaris-config-1.11.1-2022.0.1.jar:1.11.1-2022.0.1]
	at com.tencent.cloud.polaris.config.adapter.PolarisConfigFileLocator.locate(PolarisConfigFileLocator.java:75) ~[spring-cloud-starter-tencent-polaris-config-1.11.1-2022.0.1.jar:1.11.1-2022.0.1]
	at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:50) ~[spring-cloud-context-4.0.2.jar:4.0.2]
	at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:46) ~[spring-cloud-context-4.0.2.jar:4.0.2]
	at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:95) ~[spring-cloud-context-4.0.2.jar:4.0.2]
	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:605) ~[spring-boot-3.0.6.jar:3.0.6]
	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:385) ~[spring-boot-3.0.6.jar:3.0.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:309) ~[spring-boot-3.0.6.jar:3.0.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[spring-boot-3.0.6.jar:3.0.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[spring-boot-3.0.6.jar:3.0.6]
	at cn.herodotus.cloud.upms.UpmsApplication.main(UpmsApplication.java:28) ~[classes/:na]

跟踪代码发现是不兼容 Snakeyaml 2.0 初始化所致。

不知道在新版本 Spring Cloud Tencent 中,能否支持 Snakeyaml 2.0 或者做相应的兼容处理。

另外:Spring Cloud 2022.0.2 已发布,不知道能否发布对应版本。

@herodotus-ecosystem herodotus-ecosystem added the enhancement New feature or request label Apr 27, 2023
@SkyeBeFreeman
Copy link
Collaborator

  1. Snakeyaml 2.0 的可以做支持
  2. 2022可以更新

@SkyeBeFreeman SkyeBeFreeman added this to the 1.12.0 milestone Apr 28, 2023
@herodotus-ecosystem
Copy link
Contributor Author

感谢!

@SkyeBeFreeman
Copy link
Collaborator

@herodotus-cloud 如果您的项目或组织正在使用SCT,可以在这个issue留言一下~#200

@herodotus-ecosystem
Copy link
Contributor Author

@herodotus-cloud 如果您的项目或组织正在使用SCT,可以在这个issue留言一下~#200

已经登记过了。

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants