Skip to content

Commit 99d5d1a

Browse files
jamesarichclaude
andauthored
build(deps): force patched jackson-core on Dokka classpath (GHSA-r7wm-3cxj-wff9) (#6372)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 00b66dc commit 99d5d1a

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic

build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Dokka.kt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,28 @@ import org.gradle.kotlin.dsl.project
2222
import org.jetbrains.dokka.gradle.DokkaExtension
2323
import java.net.URI
2424

25+
/**
26+
* Patched jackson-core forced onto Dokka's classpaths.
27+
*
28+
* Dokka 2.x pulls jackson-core transitively (dokka-core -> jackson-dataformat-xml / -module-kotlin),
29+
* and the 2.15.x line it selects is vulnerable to GHSA-r7wm-3cxj-wff9 (async-parser `maxNumberLength`
30+
* bypass, CWE-770). Dokka is a build-time-only documentation tool, so this never ships in the app, but
31+
* pinning the patched line keeps the resolved dependency graph clean and closes the Dependabot alert.
32+
* 2.18.8 is the first patched release and the closest maintenance line to Dokka's transitive 2.15.3.
33+
*/
34+
private const val PATCHED_JACKSON_CORE = "com.fasterxml.jackson.core:jackson-core:2.18.8"
35+
36+
/** Force [PATCHED_JACKSON_CORE] on every Dokka configuration of this project (no-op elsewhere). */
37+
private fun Project.pinPatchedJacksonOnDokkaClasspaths() {
38+
configurations.configureEach {
39+
if (name.contains("dokka", ignoreCase = true)) {
40+
resolutionStrategy.force(PATCHED_JACKSON_CORE)
41+
}
42+
}
43+
}
44+
2545
fun Project.configureDokka() {
46+
pinPatchedJacksonOnDokkaClasspaths()
2647
extensions.configure<DokkaExtension> {
2748
// Use the full project path as the module name to ensure uniqueness
2849
moduleName.set(project.path.removePrefix(":").replace(":", "-").ifEmpty { project.name })
@@ -67,6 +88,7 @@ fun Project.configureDokka() {
6788
* Isolated Projects. The list should match the modules declared in `settings.gradle.kts`.
6889
*/
6990
fun Project.configureDokkaAggregation(subprojectPaths: List<String>) {
91+
pinPatchedJacksonOnDokkaClasspaths()
7092
extensions.configure<DokkaExtension> {
7193
moduleName.set("Meshtastic App")
7294
dokkaPublications.configureEach { suppressInheritedMembers.set(true) }

0 commit comments

Comments
 (0)