Add SnakeYAML 2.x compatibility#579
Merged
rmpestano merged 1 commit intodatabase-rider:masterfrom Mar 17, 2024
Merged
Conversation
Member
|
Hi @xak2000, can you rebase your PR with rider master? I'm not sure why but GH actions didn't run for this PR Thanks for the help! |
Contributor
Author
|
Hi @rmpestano, the commit is already on the rider master, isn't it? |
Contributor
Author
|
I have fixed the indentation from tabs to spaces and force-pushed, so the checks should probably trigger again. |
Member
Once the build passes I'll merge into master |
SnakeYaml 2.0 solved the unsafe deserialization vulnerability
by changing the default behavior of constructed `Yaml`
instance to restrict types which can be instantiated during
deserialization.
This behavior made impossible to define custom DataSet
replacers in YAML as they must be instantiated during
deserialization.
E.g.
caseInsensitiveStrategy: !!com.github.database.rider.core.api.configuration.Orthography 'LOWERCASE'
properties:
replacers: [!!my.package.WktReplacer {}]
Both `Orthography` enum and `WktReplacer` could not be
instantiated during YAML deserialization.
This commit fixes this behavior by configuring SnakeYAML 2.x
to use the old behavior (allow any class to be instantiated).
This is acceptable solution as dbunit.yml is loaded from the
trusted source, so the mentioned vulnerability is not relevant
here.
See:
* https://www.cve.org/CVERecord?id=CVE-2022-1471
Fixes database-rider#575
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SnakeYaml 2.0 solved the unsafe deserialization vulnerability by changing the default behavior of constructed
Yamlinstance to restrict types which can be instantiated during deserialization.This behavior made impossible to define custom DataSet replacers in YAML as they must be instantiated during deserialization.
E.g.
Both
Orthographyenum andWktReplacercould not be instantiated during YAML deserialization.This commit fixes this behavior by configuring SnakeYAML 2.x to use the old behavior (allow any class to be instantiated).
This is acceptable solution as
dbunit.ymlis loaded from the trusted source, so the mentioned vulnerability is not relevant here.See:
Fixes #575