Skip to content

Instantly share code, notes, and snippets.

@hakanai
Created April 10, 2026 21:45
Show Gist options
  • Select an option

  • Save hakanai/520f1fca281c13608add426f71aa3e86 to your computer and use it in GitHub Desktop.

Select an option

Save hakanai/520f1fca281c13608add426f71aa3e86 to your computer and use it in GitHub Desktop.
Modern way to work around CVEs in transitive dependencies

This is the current best way I'm aware of to do this in Gradle.

dependencies {
    implementation(libs.jsieve.core)
    constraints {
        implementation("org.apache.james:apache-mime4j-core:[0.8.10,0.9)") {
            because("CVE-2024-21742")
        }
    }
}

If you know a better way, let me know. This method is the 4th or 5th way I have done it so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment