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

Fix snakeyaml vulnerability issue by disabling detekt #517

Merged
merged 3 commits into from
Oct 27, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions reports-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ buildscript {
classpath "${opensearch_group}.gradle:build-tools:${opensearch_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.12.0"
// classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.12.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears the CVE is fixed in Detekt 1.22.x
https://detekt.dev/changelog#dependency-updates
Update dependency org.yaml:snakeyaml to v1.33 - [#5354](https://github.com/detekt/detekt/pull/5354)

The CVE's listed in description indicate the SnakeYaml DOS vuln is up-to(excluding) 1.32.

The Gradle plugin appears to be lockstep w/ Detekt versions
https://detekt.dev/docs/gettingstarted/gradle/#kotlin-dsl-1
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0-RC2")

Could you try updating the plugin version and see if it pulls the proper version of SnakeYaml ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking @pjfitzgibbons , I am running into build failures so will disable Detekt for the time being and upgrade the Detekt version with #520

classpath "org.jacoco:org.jacoco.agent:0.8.5"
}
}
Expand All @@ -57,7 +57,7 @@ apply plugin: 'idea'
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.pluginzip'
apply plugin: 'opensearch.testclusters'
apply plugin: 'io.gitlab.arturbosch.detekt'
// apply plugin: 'io.gitlab.arturbosch.detekt'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you remove the comments? it's hard to tell from code why they are commented. you can create an issue to track snakeyaml and revert #517 when it's fixed, or add this PR url in the TODO comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all comments and will track enabling detekt with #520

apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.kotlin.plugin.allopen'

Expand Down Expand Up @@ -107,10 +107,11 @@ configurations {
testRuntime
}

detekt {
// TODO: enable detekt when snakeyaml vulnerability is fixed
/*detekt {
config = files("detekt.yml")
buildUponDefaultConfig = true
}
}*/

configurations.testCompile {
exclude module: "securemock"
Expand Down