Repository navigation
bug: pin snakeyaml 1.26 in UserFront (CVE-2017-18640, SNYK-JAVA-ORGYAML-537645) - #476
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…-ORGYAML-537645)
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.
Summary
Fixes code-scan finding
sfind-b4a7f20d(SNYK-JAVA-ORGYAML-537645 / CVE-2017-18640, the "billion laughs" DoS through YAML aliases). The vulnerable snakeyaml 1.17 comes in transitively:spring-boot-starter-web1.5.4 →spring-boot-starter→org.yaml:snakeyaml:1.17.<properties> <java.version>1.8</java.version> + <snakeyaml.version>1.26</snakeyaml.version> </properties>snakeyaml.versionis the property the Boot 1.5 BOM already uses, so overriding it is the smallest change. 1.26 is the lowest fixed version. It addsLoaderOptions.maxAliasesForCollections(default 50).application.yml(onlyapplication.properties), so snakeyaml only matters when Boot'sYamlPropertySourceLoaderparses YAML.Verification
I couldn't reach Maven Central or
api.snyk.iofrom this session, and the 1.5.4 parent isn't in the local cache. Instead I used the cached Boot 1.5.8 parent and jars as a stand-in:maven-dependency-plugin:3.6.1:tree -Dincludes=org.yamlon a copy of the pom with the 1.5.8 parent):org.yaml:snakeyaml:jar:1.17:runtimeorg.yaml:snakeyaml:jar:1.26:runtimeYamlPropertySourceLoader(spring-boot 1.5.8, Spring 4.3.12,-Xmx256m, 10 levels × 9 aliases):java.lang.OutOfMemoryError: Java heap spaceafter about 6.4 sYAMLException: Number of aliases for non-scalar nodes exceeds the specified max=50after about 65 ms<<: *anchormerge keys. The flattened properties are the same as with 1.17.Snyk issue count (not re-run, the CLI can't reach
api.snyk.io): before, 1 issue for SNYK-JAVA-ORGYAML-537645 (snakeyaml 1.17 is in the vulnerable range[,1.26)). After, 0 expected, because 1.26 is outside that range. I did not get this number from a Snyk re-scan.Not run:
mvn teston the real 1.5.4 parent. It needs Maven Central, and the only test (UserFrontApplicationTests.contextLoads) also needs MySQL.Still open: the later snakeyaml CVEs (CVE-2022-25857, CVE-2022-38749/50/51/52, CVE-2022-41854 need 1.31–1.33; CVE-2022-1471 needs 2.x).
Overlaps: older open PRs #160, #210, #218, #226 and #228 pin snakeyaml 1.31–1.33, and #171 pins 2.0. Each of those also clears this CVE. This PR was opened for the new finding as required, but only one snakeyaml pin should land.
Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/13945660dd064444bf2f4f43857e5473
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/13945660dd064444bf2f4f43857e5473?variant=devin