@@ -22,7 +22,28 @@ import org.gradle.kotlin.dsl.project
2222import org.jetbrains.dokka.gradle.DokkaExtension
2323import 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+
2545fun 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 */
6990fun 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